[GHC] #13759: Strange error message for deriving Data
GHC
ghc-devs at haskell.org
Tue May 30 21:25:11 UTC 2017
#13759: Strange error message for deriving Data
-------------------------------------+-------------------------------------
Reporter: alanz | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: #12245 | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by RyanGlScott):
alanz helped me figure out what was going on. You won't hit the bug with
the original code, but you will with this slightly tweaked code:
{{{#!hs
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE FlexibleInstances #-}
import Data.Data
data Pass = Parsed | Renamed | Typechecked
deriving (Data)
data GHC (c :: Pass)
deriving instance Data GhcPs
deriving instance Data GhcRn
deriving instance Data GhcTc
-- Type synonyms as a shorthand for tagging
type GhcPs = GHC 'Parsed
type GhcRn = GHC 'Renamed
type GhcTc = GHC 'Typechecked
}}}
Crucially, we're deriving instances for the type synonyms.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13759#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list