[GHC] #15562: `-XStrict -XNoStrict` is not neutral
GHC
ghc-devs at haskell.org
Fri Aug 24 13:35:56 UTC 2018
#15562: `-XStrict -XNoStrict` is not neutral
-------------------------------------+-------------------------------------
Reporter: hvr | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone: 8.6.1
Component: Compiler | Version: 8.4.3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by RyanGlScott):
I think this extends far beyond `Strict`—in fact, I'd wager that it
affects every language extension that implies other language extensions.
As another data point, `TypeFamilies` implies `ExplicitNamespaces`,
`KindSignatures`, and `MonoLocalBinds`. Here's a GHCi session which shows
that `-XTypeFamilies -XNoTypeFamilies` is similarly un-neutral:
{{{
$ /opt/ghc/8.4.3/bin/ghci
GHCi, version 8.4.3: http://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /home/ryanglscott/.ghci
λ> :set
options currently set: none.
base language is: Haskell2010
with the following modifiers:
-XNoDatatypeContexts
-XNondecreasingIndentation
GHCi-specific dynamic flag settings:
other dynamic, non-language, flag settings:
-fignore-optim-changes
-fignore-hpc-changes
-fimplicit-import-qualified
warning settings:
λ> :set -XTypeFamilies
λ> :set
options currently set: none.
base language is: Haskell2010
with the following modifiers:
-XNoDatatypeContexts
-XExplicitNamespaces
-XKindSignatures
-XMonoLocalBinds
-XNondecreasingIndentation
-XTypeFamilies
GHCi-specific dynamic flag settings:
other dynamic, non-language, flag settings:
-fignore-optim-changes
-fignore-hpc-changes
-fimplicit-import-qualified
warning settings:
λ> :set -XNoTypeFamilies
λ> :set
options currently set: none.
base language is: Haskell2010
with the following modifiers:
-XNoDatatypeContexts
-XExplicitNamespaces
-XKindSignatures
-XMonoLocalBinds
-XNondecreasingIndentation
GHCi-specific dynamic flag settings:
other dynamic, non-language, flag settings:
-fignore-optim-changes
-fignore-hpc-changes
-fimplicit-import-qualified
warning settings:
}}}
So ultimately, the question here is: if enabling language extension `A`
implies `B`, should `NoA` imply `NoB`? I'm not sure that it should. After
all, someone legitimately might want to combine `NoTypeFamilies` with
`KindSignatures`, but if `NoTypeFamilies` implied `NoKindSignatures`, then
this order:
{{{#!hs
{-# LANGUAGE NoTypeFamilies #-}
{-# LANGUAGE KindSignatures #-}
}}}
Would enable `KindSignatures`, but this order:
{{{#!hs
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE NoTypeFamilies #-}
}}}
Would disable `KindSignatures`! (This is especially noteworthy since many
folks like to list language extensions in alphabetical order, so they're
more likely to hit this scenario.)
Therefore, my inclination is to say that this is //not// a bug. Of course,
if this behavior isn't documented, then it should be.
Do others have differing viewpoints?
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15562#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list