
21 Dec
2005
21 Dec
'05
12:15 p.m.
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