[GHC] #9205: Deriving Typeable for poly-kinded data family gives confusing error message

#9205: Deriving Typeable for poly-kinded data family gives confusing error message ------------------------------------+------------------------------------- Reporter: dfranke | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ------------------------------------+------------------------------------- The following works fine: {{{ {-# LANGUAGE TypeFamilies, DeriveDataTypeable, StandaloneDeriving #-} module Test where import Data.Typeable class Foo a where data family Bar a deriving instance (Typeable Bar) }}} However, if I add `-XPolyKinds`, I get a horribly confusing error: {{{ Test.hs:9:1: Can't make a derived instance of ‘Typeable Bar’: Deriving Typeable is not allowed for family instances; derive Typeable for ‘Bar’ alone In the stand-alone deriving instance for ‘Typeable Bar’ }}} The correct way to resolve the error is to add a monomorphic kind signature to Bar, e.g. `data family Bar (a :: *)`. Perhaps the error message could suggest this? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9205 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9205: Deriving Typeable for poly-kinded data family gives confusing error message -------------------------------------+------------------------------------ Reporter: dfranke | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by dreixel): * status: new => closed * resolution: => fixed Comment: This is fixed in HEAD. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9205#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9205: Deriving Typeable for poly-kinded data family gives confusing error message -------------------------------------+------------------------------------ Reporter: dfranke | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by simonpj): Fixed, as in: it compiles with or without `PolyKinds`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9205#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9205: Deriving Typeable for poly-kinded data family gives confusing error message -------------------------------------+------------------------------------ Reporter: dfranke | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by dreixel): Replying to [comment:2 simonpj]:
Fixed, as in: it compiles with or without `PolyKinds`.
Which is what we want, right? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9205#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9205: Deriving Typeable for poly-kinded data family gives confusing error message -------------------------------------+------------------------------------ Reporter: dfranke | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by simonpj): Yes, that's what we want. I was just clarifying what "fixed" meant; you could have meant "rejected with a better error message". -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9205#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9205: Deriving Typeable for poly-kinded data family gives confusing error message -------------------------------------+------------------------------------ Reporter: dfranke | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by dreixel): Right, thanks! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9205#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC