
5 Sep
2007
5 Sep
'07
11:49 p.m.
G'day all.
Slight nit...
Quoting ok
I've been thinking about making a data type an instance of MonadPlus. From the Haddock documentation at haskell.org, I see that any such instance should satisfy
mzero `mplus` x = x x `mplus` mzero = x mzero >>= f = mzero v >> mzero = mzero
As discussed previously, that last "law" is wrong. In particular, it can't be true of any monad transformer: lift fireMissiles >> mzero /= mzero
but is that all there is to it? Are there no other requirements for MonadPlus to make sense?
It's proposed to split nondeterminism-like monads and error catch-like monads to allow for some other laws: http://haskell.org/haskellwiki/MonadPlus_reform_proposal Cheers, Andrew Bromage