Boost logo

Boost :

From: David Bergman (davidb_at_[hidden])
Date: 2003-10-21 09:50:02


Miroslav wrote:

> OK, I think what's missing here is why monads are absolutely
> necessary in a language like Haskell. While Haskell has
> different (non-monadic) ways to handle List and Maybe monads,
> the real issue here is the IO monad.
>
> Haskell is a lazy language. In fact, there is no way to turn
> or override laziness in Haskell - basically every operation
> in Haskell is understood to take some arguments and return a
> result. Side-effects are non only not allowed, they can't be
> expressed.

This has nothing to do with laziness. One can conceive a lazy albeit
side-effecting language, and view the I/O channels as lazy streams and the
output stream as having an eager consumer.

It has to do with purity, that Haskell is a pure language in the sense of an
expression ALWAYS evaluating to the same value, so that the same exact
expression can be substituted for that computed value wherever, whenever.

/David


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk