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

Bayley, Alistair Alistair.Bayley at invesco.com
Fri May 23 07:05:55 EDT 2008

> From: haskell-cafe-bounces at haskell.org 
> [mailto:haskell-cafe-bounces at haskell.org] On Behalf Of Jules Bean
> 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 =>)

Is there a reason not to recommend Either, if you want to return error
information? It is an instance of MonadError.

Confidentiality Note: The information contained in this message,
and any attachments, may contain confidential and/or privileged
material. It is intended solely for the person(s) or entity to
which it is addressed. Any review, retransmission, dissemination,
or taking of any action in reliance upon this information by
persons or entities other than the intended recipient(s) is
prohibited. If you received this in error, please contact the
sender and delete the material from any computer.

More information about the Haskell-Cafe mailing list