Monad of no `return` Proposal (MRP): Moving `return` out of `Monad`

David Feuer david.feuer at gmail.com
Mon Sep 28 02:56:13 UTC 2015


On Sep 27, 2015 9:56 PM, "Richard Eisenberg" <eir at cis.upenn.edu> wrote:
>
> I like this idea -- I, for one, often forget to consider the effect
legacy written material has. But if we're doing this for Monad, why not
just come up with a pragma so that the magic doesn't have to be baked in?
As in, witness the new definition for Monad:
>
> > class Applicative m => Monad m where
> >   ...
> >   {-# REMOVED return "The `return` method has been removed from Monad.
Use `pure` in Applicative instead" #-}
>
> (Please fix my warning text.)
>
> We people with direct access to GHC might not be the only ones who want
to refactor a method out from a class.

That's an excellent idea, and I think it makes sense to offer it at the
module level as well as the class level. Just change DEPRECATED to REMOVED
when it's actually removed. Speaking of such, has the deprecated export
proposal made any headway?

David Feuer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20150927/38f78483/attachment-0001.html>


More information about the Libraries mailing list