Skip to content

-XStrict doesn't imply -XStrictData

Compiling this code:

{-# LANGUAGE Strict #-}

data Lazy a = Lazy ~a

main :: IO ()
main = case Lazy undefined of
            Lazy _ -> putStrLn "Lazy"

fails with the following error:

$ .\inplace\bin\ghc-stage2.exe ../Lazy.hs
[1 of 1] Compiling Main             ( ..\Lazy.hs, ..\Lazy.o )

..\Lazy.hs:3:15: error:
    * Lazy annotation (~) without StrictData
        on the first argument of `Lazy'
    * In the definition of data constructor `Lazy'
      In the data type declaration for `Lazy'

I was under the impression that -XStrict implied -XStrictData. Is this not the case?

Trac metadata
Trac field Value
Version 7.11
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC adamse, osa1, tibbe
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information