[Haskell-cafe] Re: What are side effects in Haskell?

Achim Schneider barsoap at web.de
Sat Jan 3 00:28:29 EST 2009


"Reiner Pope" <reiner.pope at gmail.com> wrote:

> 2009/1/3 Conal Elliott <conal at conal.net>:
> > Are there other thoughts & insights about the source of the idea
> > that "everything is a function"?
> >
> 
> Lazy evaluation can make values seem like functions, given that
> laziness can be modeled in a strict imperative language by 0-argument
> functions.
> 
> Also, in an uncurried language, decreasing the number of arguments to
> a function, still keeps it a function, eg
>    foo(int a, int b);  // 2 arguments
>    foo(int a);   // 1 argument
>    foo();   // 0 arguments, but still a function
> In a strict language, there is a distinction between 0-argument
> functions and values; there isn't in Haskell, but it is still nice to
> maintain the idea of "0-argument functions" in Haskell -- which are
> just values.
> 
You can factor a cool intuitive understanding about IO actions not
being the action itself, but just tokens that represent an action, out
of this, by adding just one sentence.

I guess the proper way to offset functions and values depends on what
you want to explain, and multiple views on the same thing can't hurt.

Conal, you aren't interrogating the list to figure out how to write a
Haskell version of the wizard book, are you? We'd have to stop the
pizza deliveries if you stop working on reactive... ;)

-- 
(c) this sig last receiving data processing entity. Inspect headers
for copyright history. All rights reserved. Copying, hiring, renting,
performance and/or quoting of this signature prohibited.




More information about the Haskell-Cafe mailing list