I think that MonadZero m => ... is better than just Maybe. If you can
have more general solution for free, why fight it?
On 23 May 2008, at 14:55, Jules Bean wrote:
Krasimir Angelov wrote:
The monads design is used in Data.Map i.e.
lookup :: (Monad m, Ord k) => k -> Map k a -> m a
which is widely considered a poor design decision and a wart on
Data.Map.
:-)
Seriously, if you don't return a useful error message, then Maybe is
as good as it gets, why not use it?
(And there really is only one kind of error possible here, in each
case)
'fail' only adds information in the case it has a useful error
message (in which case I'd encourage MonadError m =>)
Jules
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe