
4 Jun
2007
4 Jun
'07
2:47 p.m.
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