[GHC] #15562: `-XStrict -XNoStrict` is not neutral

GHC ghc-devs at haskell.org
Fri Aug 24 10:42:21 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:                    |
-------------------------------------+-------------------------------------
Description changed by hvr:

Old description:

> I assumed we already had a ticket about this, but it appears we have not.
>
> I'm not saying this is a necessarily a bug in the implementation; but we
> should make sure this is properly documented in the user's guide, and
> ideally justify why it's done this way rather than the alternatives:
>

> As described in StrictPragma,
>
> > `Strict` implies `StrictData`
>
> Currently however the inverse case does not hold, i.e. `NoStrict` does
> *not* imply `NoStrictData`
>

>

> This has the surprising property (assuming these were left-most flags on
> the CLI) that
>
> - `-XStrict -XNoStrict` == `-XStrictData`
>
> - `-XStrictData -XNoStrict` == `-XStrictData`
>

>
> However, if `-XNoStrict` was to naively imply `-XNoStrictData`, we'd have
> the properties
>

> - `-XStrict -XNoStrict` == *id*
>
> - `-XStrictData -XNoStrict` == *id*
>

> This might be a bit less confusing; another variant would be
>

> - `-XStrict -XNoStrict` == *id*
>
> - `-XStrictData -XNoStrict` == `-XStrictData`
>

> Btw, I'm not sure what the following means:
>
> - `-XStrict -XNoStrictData` == ?

New description:

 I assumed we already had a ticket about this, but it appears we have not.

 I'm not saying this is a necessarily a bug in the implementation; but we
 should make sure this is properly documented in the user's guide, and
 ideally justify why it's done this way rather than the alternatives:


 As described in StrictPragma,

 > `Strict` implies `StrictData`

 Currently however the inverse case does not hold, i.e. `NoStrict` does
 *not* imply `NoStrictData`




 This has the surprising property (assuming these were left-most flags on
 the CLI) that

 - `-XStrict -XNoStrict` == `-XStrictData`

 - `-XStrictData -XNoStrict` == `-XStrictData`



 However, if `-XNoStrict` was to naively imply `-XNoStrictData`, we'd have
 the properties


 - `-XStrict -XNoStrict` == ∅

 - `-XStrictData -XNoStrict` == ∅


 This might be a bit less confusing; another variant would be


 - `-XStrict -XNoStrict` == ∅

 - `-XStrictData -XNoStrict` == `-XStrictData`

 (strictly speaking, it's not ∅ unless it's these are the left-most flags;
 also, any `-XNo` still has a cancellation effect on any flags occuring to
 the left on the CLI)


 Btw, I'm not sure what the following means:

 - `-XStrict -XNoStrictData` == ?

--

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15562#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list