Data declaration order matters to compiler.
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TemplateHaskell #-}
import Control.Lens.TH (makeLenses)
data Handle h where
PlayerHandle :: Int -> Handle Player
-- GHC 7.8.3 complains that NonPlayer is not in scope
NonPlayerHandle :: Int -> Handle NonPlayer
data Player = Player
-- Deferring this until after NonPlayer is defined, resolves the compile error.
-- Commenting this out also works.
makeLenses ''Player
data NonPlayer
(The exact version of 'lens' I have tried this with is 'lens-4.7' if that matters.)
Trac metadata
Trac field | Value |
---|---|
Version | 7.8.3 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |