[Haskell-cafe] Views

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Sun Sep 14 11:30:56 EDT 2008


On 2008 Sep 14, at 10:01, Stephan Friedrichs wrote:
> 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 ;)


MonadZero is what "fail" replaced in Haskell98.  Many people consider  
this a serious mistake.

-- 
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH




More information about the Haskell-Cafe mailing list