[Haskell-cafe] Re: Tutorial uploaded

Wolfgang Jeltsch wolfgang at jeltsch.net
Wed Dec 21 12:15:23 EST 2005


Am Mittwoch, 21. Dezember 2005 16:30 schrieb Daniel Carrera:
> [...]

> Would it be fair to say that do-blocks are imperative blocks in an otherwise
> functional program?

Not really.  do expressions are (normally) equivalent to expressions 
containing applications of (>>=) and/or (>>).  If the monad you use is IO 
then a do expression isn't really an imperative block but an expression whose 
value is a *description* of an imperative block.  If the monad you use is not 
IO then a do expression may have nothing to do with imperative code at all.

> [...]

> Cheers,
> Daniel.

Best wishes,
Wolfgang


More information about the Haskell-Cafe mailing list