Dan Weston wrote:
Is this true? I thought do (like all sugar) was desugared before semantic analysis. So long as you have the right >>=, return, and fail in scope, I would have thought the desugaring is oblivious to their definition (and particularly ignorant of instancing of the Monad typeclass).
Some compilers also type-check when desugaring; if actions in the do-block are not of a Monad instance type, it is rejected. See also an earlier thread on the validity of "do { 1 }".
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe