[Haskell-cafe] The evil GADTs extension in ghci 7.8.4 (maybe in other versions too?)

adam vogt vogt.adam at gmail.com
Wed Jun 10 22:47:51 UTC 2015


On Jun 10, 2015 3:47 PM, "Roman Cheplyaka" <roma at ro-che.info> wrote:
>
> On 10/06/15 22:21, Nathan Bouscal wrote:
> > On Wed, Jun 10, 2015 at 12:11 PM, Roman Cheplyaka <roma at ro-che.info
> > <mailto:roma at ro-che.info>> wrote:
> >
> >     On 10/06/15 21:50, wren romano wrote:
> >     > On Thu, Jun 4, 2015 at 11:43 PM, Edward Z. Yang <ezyang at mit.edu
<mailto:ezyang at mit.edu>> wrote:
> >     >> GHC used to always generalize let-bindings, but our experience
> >     >> with GADTs lead us to decide that let should not be generalized
> >     >> with GADTs.  So, it's not like we /wanted/ MonoLocalBinds, but
> >     >> that having them makes the GADT machinery simpler.
> >     >>
> >     >> This blog post gives more details on the matter:
> >     >>     https://ghc.haskell.org/trac/ghc/blog/LetGeneralisationInGhc7
> >     >
> >     > The fact that -XGADTs (in isolation) implies -XMonoLocalBinds
isn't
> >     > the problem. The problem is, the order in which language pragma
are
> >     > offered should not matter. Whether I say {-# LANGUAGE GADTs,
> >     > NoMonoLocalBinds #-} or {-# LANGUAGE NoMonoLocalBinds, GADTs #-}
> >     > shouldn't matter. Both should mean the same thing, regardless of
how
> >     > annoying it may be to work in that language.
> >
> >     The current behavior may be surprising if you are not aware of it,
but
> >     it's the only sensible one. Otherwise, what should the meaning of
> >
> >     {-# LANGUAGE MonoLocalBinds, NoMonoLocalBinds #-}
> >
> >     be?
> >
> >     Roman
> >
> >
> > Arguably it should be a compiler warning.
>
> You could have enabled one of them project-wise and the other one for a
> sepcific module. Being able to override extensions is useful.

It looks like https://ghc.haskell.org/trac/ghc/ticket/3085 would cover this
situation
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20150610/3b6383d0/attachment.html>


More information about the Haskell-Cafe mailing list