[Haskell-cafe] Data.Tree.Zipper in the standard libraries

Jules Bean jules at jellybean.co.uk
Fri May 23 06:55:10 EDT 2008

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 =>)


More information about the Haskell-Cafe mailing list