
Hello,
I think that we should make both changes (make Applicative a
super-class of Monad, and remove the "fail" method from Monad). Code
will break but we can fix it.
By the way, just for reference, the proposal to have a separate
failure class and using it in the "do" notation, is how things used to
be back in Haskell 1.4 (one version before Haskell 98). For the
curious, take a look at page 21 of
http://haskell.org/definition/haskell-report-1.4.ps.gz
-Iavor
On Thu, Dec 16, 2010 at 3:57 PM, Lennart Augustsson
IO
On Thu, Dec 16, 2010 at 6:03 PM, John Smith
wrote: On 15/12/2010 14:31, Lennart Augustsson wrote:
Yes, I think there should be a MonadFail distinct from MonadPlus. Some types, like IO, are not in MonadPlus, but have a special implementation of the fail method.
Personally, I think fail should just be removed, but that would break existing code. The fail method was introduced for the wrong reasons (better error messages was the excuse).
Which other monads (other than MonadPlus subclasses) define fail?
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe