[Haskell-cafe] [Haskell] Functor => Applicative => Monad
conor at strictlypositive.org
Wed Dec 15 19:08:32 CET 2010
On 15 Dec 2010, at 17:48, Brent Yorgey wrote:
> On Wed, Dec 15, 2010 at 06:25:30PM +0100, Maciej Piechotka wrote:
>> On Wed, 2010-12-15 at 13:51 +0200, John Smith wrote:
>>> On 15/12/2010 11:39, Lennart Augustsson wrote:
>>>> Any refutable pattern match in do would force MonadFail (or
>>>> MonadPlus if you prefer). So
>>>> As far as type inference and desugaring goes, it seems very
>>>> little would have to be changed in an implementation.
>>> Is there a need for a MonadFail, as distinct from mzero? fail
>>> always seems to be defined as error in ordinary monads,
>>> and as mzero in MonadPlus (or left at the default error).
>> Not all types can implement mplus to begin with even if they can have
>> 'zero' type. For example technically Maybe breaks the laws while
>> having useful fail:
> But that depends on what laws you choose for MonadPlus. See
> http://www.haskell.org/haskellwiki/MonadPlus .
What has any of this to do with monads?
More information about the Haskell-Cafe