
6 Jan
2009
6 Jan
'09
10:33 a.m.
Hello, I wonder why there isn’t a MonadPlus instance for ContT. In my opinion, this one would be natural:
instance (MonadPlus monad) => MonadPlus (ContT result monad) where
mzero = ContT $ return mzero
ContT cont1 `mplus` ContT cont2 = ContT $ liftM2 mplus cont1 cont2
return and liftM2 are the ones of (->) (o -> monad result). What do you think? Best wishes, Wolfgang