
On Oct 15, 2007, at 7:02 , jerzy.karczmarczuk@info.unicaen.fr wrote:
IO is different, you *cannot* make it non-monadic.
Not really true; it's just much more painful. You just e.g. explicitly do what the ghc library's implementation of IO does: construct a chain of functions with an opaque (and optionally(?) existential to enforce the opacity) "RealWorld" type which is passed as state from one invocation to the next, with the "top level" application partially applied. Or one of the operationally equivalent tricks used by other Haskell runtime implementations, cf. "IO Inside". It's not so much hard as it is far too much "busywork" for a programmer to want to deal with when programming... hence hiding the scaffolding in the type, which is perhaps the most general description of what a Haskell monad actually is. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH