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

Miguel Mitrofanov miguelimo38 at yandex.ru
Fri May 23 11:02:39 EDT 2008


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
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe



More information about the Haskell-Cafe mailing list