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

Henning Thielemann lemming at henning-thielemann.de
Thu Oct 1 16:22:15 UTC 2015


On Sun, 27 Sep 2015, David Feuer wrote:

> 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?

I like the idea of a REMOVED pragma very much. After a deprecated function 
is actually removed it is hard to find out how to fix the code. I often 
ignore DEPRECATED warnings because respecting them would break my code for 
older GHC versions.


More information about the Libraries mailing list