[Haskell-cafe] instance Monad (Except err)

Tony Morris tonymorris at gmail.com
Mon May 4 05:22:04 EDT 2009


Martijn van Steenbergen wrote:
> Hello,
>
> Mr. McBride and mr. Paterson define in their Applicative paper:
>
>> data Except e a = OK a | Failed e
>> instance Monoid e => Applicative (Except e) where ...
>
> Sometimes I'd still like to use >>= on Excepts but this "feels" wrong
> somehow, because it doesn't use monoids nicely like the Applicative
> instance does. Are there any good reasons such a Monad instance
> shouldn't be defined? Does it violate any laws, for example?
>
> Thanks,
>
> Martijn.
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
I'm sure you could, but then ap /= (<*>).

This seems related to a question that I once asked
http://www.haskell.org/pipermail/haskell-cafe/2009-January/054139.html


-- 
Tony Morris
http://tmorris.net/




More information about the Haskell-Cafe mailing list