Hi Cristiano,

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).

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:

* 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".

* 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.)

Are there other thoughts & insights about the source of the idea that "everything is a function"?

Thanks,

  - Conal

On Fri, Jan 2, 2009 at 2:52 AM, Cristiano Paris <frodo@theshire.org> wrote:
On Tue, Dec 30, 2008 at 8:35 AM, Conal Elliott <conal@conal.net> wrote:
>> Everything in Haskell is a function [...]
>
> Where did this idea come from?
>
> I'd say every expression in Haskell denotes a pure value, only some of which
> are functions (have type a->b for some types a & b).

Maybe more formally correct, but my statement still holds true as any
values can be tought as constant functions, even those representing
functions themselves.

Cristiano