Monad of no `return` Proposal (MRP): Moving `return` out of `Monad`
ekmett at gmail.com
Fri Sep 25 02:31:25 UTC 2015
Sadly liftM vs. liftA actually retains a useful distinction, one is a
definition of fmap in terms of (>>=) and the other in terms of (<*>).
`ap` gives a default definition of (<*>) in terms of (>>=), but if someone
instead writes (<*>) = liftM2 id today, then erasing the distinction would
turn that into a circular definition, transforming obviously-correct
existant code silently into a _|_.
On Thu, Sep 24, 2015 at 8:36 PM, Dan Burton <danburton.email at gmail.com>
> What about the derived functions in Control.Monad, such as liftM? Shall we
> similarly relax their constraints to Applicative and consider them
> "legacy"? (Did this already happen when I wasn't looking?)
> On Thursday, September 24, 2015, John Wiegley <johnw at newartisans.com>
>> >>>>> Herbert Valerio Riedel <hvr at gnu.org> writes:
>> > TLDR: To complete the AMP, turn `Monad(return)` method into a
>> > top-level binding aliasing `Applicative(pure)`.
>> Very much +1.
>> Libraries mailing list
>> Libraries at haskell.org
> -- Dan Burton
> Libraries mailing list
> Libraries at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libraries