[Haskell-cafe] Monad of no `return` Proposal (MRP): Moving `return` out of `Monad`

Johan Tibell johan.tibell at gmail.com
Mon Oct 5 19:05:40 UTC 2015


On Mon, Oct 5, 2015 at 9:02 PM, Erik Hesselink <hesselink at gmail.com> wrote:

> On 5 October 2015 at 20:58, Sven Panne <svenpanne at gmail.com> wrote:
> > 2015-10-05 17:09 GMT+02:00 Gershom B <gershomb at gmail.com>:
> >>
> >> [...] As for libraries, it has been pointed out, I believe, that without
> >> CPP one can write instances compatible with AMP, and also with AMP +
> MRP.
> >> One can also write code, sans CPP, compatible with pre- and post- AMP.
> [...]
> >
> > Nope, at least not if you care about -Wall: If you take e.g. (<$>) which
> is
> > now part of the Prelude, you can't simply import some compatibility
> module,
> > because GHC might tell you (rightfully) that that import is redundant,
> > because (<$>) is already visible through the Prelude. So you'll have to
> use
> > CPP to avoid that import on base >= 4.8, be it from it Data.Functor,
> > Control.Applicative or some compat-* module. And you'll have to use CPP
> in
> > each and every module using <$> then, unless I miss something obvious.
> > AFAICT all transitioning guides ignore -Wall and friends...
>
> Does the hack mentioned on the GHC trac [1] work for this? It seems a
> bit fragile but that page says it works and it avoids CPP.
>

No it doesn't, if you also don't want closed import lists (which you
should).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-prime/attachments/20151005/fbc07861/attachment-0001.html>


More information about the Haskell-prime mailing list