David House wrote:
Juozas, you could only use do-notation if your Parser type were
declared an instance of the Haskell type-class Monad. Seeing as you
haven't done this, you have to stick to the "de-sugared" version
involving (>>=) and return:

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).

Dan

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to