
30 Jul
2010
30 Jul
'10
8:48 a.m.
On Friday 30 July 2010 13:56:44, Antoine Latter wrote:
You could always add a MondPlus instance to IO directly (or a newtype wrapper).
'mplus' would set up exception handling and 'mzero' would through an exception. You might want to limit it to a subset of exceptions, though.
Once upon a time, there was a MonadPlus instance for IO. However, one of the laws a MonadPlus instance should satisfy is m >> mzero === mzero You can't have that in IO, since there's no unPutStrLn and such. Therefore, the MonadPlus instance for IO was removed.