
23 Jan
2005
23 Jan
'05
8:22 a.m.
Ashley Yakeley
But only some instances (such as []) satisfy this:
(mplus a b) >>= c = mplus (a >>= c) (b >>= c)
Other instances (IO, Maybe) satisfy this:
mplus (return a) b = return a
I think mplus should be separated into two functions.
This would prevent using mplus in a single parser which - depending on the underlying monad used - backtracks or not. -- __("< Marcin Kowalczyk \__/ qrczak@knm.org.pl ^^ http://qrnik.knm.org.pl/~qrczak/