Hi Cristiano,<br><br>Similarly, any value can be thought of as a list (perhaps singleton), a Maybe (Just), a pair ((,) undefined or (,) mempty), an IO (return), ... (any Applicative).<br><br>And yet I've heard "everything is a function" on several occasions, but not these others. Hence my (continuing) puzzlement about the source of that idea. I have some speculations:<br>
<br>* In pure "OO" programming, everything is an object, so in pure "functional" programming, one might assume everything is a function. I find the term "value-oriented programming" a more accurate label than "functional programming".<br>
<br>* C has definitions for functions but assignments for other types. Since pure functional languages eliminate assignment, one might assume that only functions remain. (I also hear people refer to top-level definitions in a Haskell module as "functions", whether they're of function type or not.)<br>
<br>Are there other thoughts & insights about the source of the idea that "everything is a function"?<br><br>Thanks,<br><br> - Conal<br><br><div class="gmail_quote">On Fri, Jan 2, 2009 at 2:52 AM, Cristiano Paris <span dir="ltr"><<a href="mailto:frodo@theshire.org">frodo@theshire.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">On Tue, Dec 30, 2008 at 8:35 AM, Conal Elliott <<a href="mailto:conal@conal.net">conal@conal.net</a>> wrote:<br>
>> Everything in Haskell is a function [...]<br>
><br>
> Where did this idea come from?<br>
><br>
> I'd say every expression in Haskell denotes a pure value, only some of which<br>
> are functions (have type a->b for some types a & b).<br>
<br>
</div>Maybe more formally correct, but my statement still holds true as any<br>
values can be tought as constant functions, even those representing<br>
functions themselves.<br>
<font color="#888888"><br>
Cristiano<br>
</font></blockquote></div><br>