[Haskell-cafe] Views

Stephan Friedrichs deduktionstheorem at web.de
Sun Sep 14 10:01:48 EDT 2008


Johannes Waldmann wrote:
>> I think the crux of
>> the matter was that a monad is too general. Either there is a result or
>> there is not. That's precisely the intended use of a Maybe.
> 
> Indeed "Monad m =>" is dangerous here
> because not every Monad has a reasonable definition of "fail".
> 
> But that seems to be a problem in the (current) definition of "Monad",
> and its solution was "MonadZero", no?

I agree that the MonadZero class with a useful 'zero' :: m a would be
the right abstraction for views. But MonadZero is not part of base, mtl
or any other common package, or am I missing something? Changing this is
beyond a simple heap package ;)

-- 

Früher hieß es ja: Ich denke, also bin ich.
Heute weiß man: Es geht auch so.

 - Dieter Nuhr


More information about the Haskell-Cafe mailing list