[Haskell-cafe] Re: Can we come out of a monad?

Martijn van Steenbergen martijn at van.steenbergen.nl
Tue Aug 10 17:21:18 EDT 2010

On 8/2/10 7:09, Ertugrul Soeylemez wrote:
> Given the definition of a Haskell function, Haskell is a pure language.
> The notion of a function in other languages is not:
>    int randomNumber();
> The result of this function is an integer.  You can't replace the
> function call by its result without changing the meaning of the program.

I'm not sure this is fair. It's perfectly okay to replace a call 
"randomNumber()" by that method's *body* (1), which is what you argue is 
okay in Haskell.


(1) Modulo some renaming, and modulo the complicated non-compositional 
meanings of control statements such as "return", etc.

More information about the Haskell-Cafe mailing list