[GHC] #7704: Phantom types break new polykind Typeable with either StandaloneDeriving or AutoDeriveTypeable

#7704: Phantom types break new polykind Typeable with either StandaloneDeriving or AutoDeriveTypeable -----------------------------+---------------------------------------------- Reporter: nwf | Owner: Type: bug | Status: new Priority: normal | Component: Compiler Version: 7.7 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- This test program, reduced from an attempt to bring ekmett's tagged package to HEAD, {{{ {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE AutoDeriveTypeable #-} newtype Tagged s b = Tagged { unTagged :: b } }}} results in {{{ GHCi, version 7.7.20130218: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. [1 of 1] Compiling Main ( typeable.hs, interpreted ) typeable.hs:5:1: Derived typeable instance must be of form (Typeable Tagged) In the stand-alone deriving instance for `Data.Typeable.Internal.Typeable Tagged' }}} This message is also emitted if I replace `AutoDeriveTypeable` `StandaloneDeriving` and `deriving instance Typeable Tagged`. However, a "deriving (Typeable)" clause on the newtype definition works just fine. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7704 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7704: Phantom types break new polykind Typeable with either StandaloneDeriving or AutoDeriveTypeable -----------------------------+---------------------------------------------- Reporter: nwf | Owner: dreixel Type: bug | Status: new Priority: normal | Component: Compiler Version: 7.7 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- Changes (by dreixel): * owner: => dreixel Comment: Thanks for reporting; I'll look into it. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7704#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7704: Phantom types break new polykind Typeable with either StandaloneDeriving or AutoDeriveTypeable -----------------------------+---------------------------------------------- Reporter: nwf | Owner: dreixel Type: bug | Status: new Priority: normal | Component: Compiler Version: 7.7 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- Changes (by kazu-yamamoto): * cc: kazu@… (added) -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7704#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7704: Phantom types break new polykind Typeable with either StandaloneDeriving or AutoDeriveTypeable -----------------------------+---------------------------------------------- Reporter: nwf | Owner: dreixel Type: bug | Status: new Priority: normal | Component: Compiler Version: 7.7 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- Comment(by kazu-yamamoto): Removing PolyKinds works in my environment. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7704#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7704: Phantom types break new polykind Typeable with either StandaloneDeriving or AutoDeriveTypeable -----------------------------+---------------------------------------------- Reporter: nwf | Owner: dreixel Type: bug | Status: new Priority: normal | Component: Compiler Version: 7.7 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- Comment(by monoidal): In fact the "deriving (Typeable)" clause does not work either: {{{ {-# LANGUAGE DeriveDataTypeable, PolyKinds #-} import Data.Typeable newtype Tagged s b = Tagged { unTagged :: b } deriving (Typeable) k :: Typeable u => u -> Int k _ = 0 m = k (Tagged 0 :: Tagged Int Int) }}} (The code compiles without PolyKinds.) -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7704#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7704: Phantom types break new polykind Typeable with either StandaloneDeriving or
AutoDeriveTypeable
-----------------------------+----------------------------------------------
Reporter: nwf | Owner: dreixel
Type: bug | Status: new
Priority: normal | Component: Compiler
Version: 7.7 | Keywords:
Os: Unknown/Multiple | Architecture: Unknown/Multiple
Failure: None/Unknown | Blockedby:
Blocking: | Related:
-----------------------------+----------------------------------------------
Comment(by jpm@…):
commit 25234646e96922e3f39e85134521da8552da42ad
{{{
Author: Jose Pedro Magalhaes

#7704: Phantom types break new polykind Typeable with either StandaloneDeriving or AutoDeriveTypeable ---------------------------------+------------------------------------------ Reporter: nwf | Owner: dreixel Type: bug | Status: closed Priority: normal | Component: Compiler Version: 7.7 | Resolution: fixed Keywords: | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: None/Unknown Blockedby: | Blocking: Related: | ---------------------------------+------------------------------------------ Changes (by dreixel): * status: new => closed * resolution: => fixed Comment: Fixed, thanks for the report. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7704#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7704: Phantom types break new polykind Typeable with either StandaloneDeriving or AutoDeriveTypeable --------------------------------------------+------------------------------- Reporter: nwf | Owner: dreixel Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: fixed | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Difficulty: Unknown Testcase: deriving/should_compile/T7704 | Blockedby: Blocking: | Related: --------------------------------------------+------------------------------- Changes (by simonpj): * testcase: => deriving/should_compile/T7704 * difficulty: => Unknown -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7704#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7704: Phantom types break new polykind Typeable with either StandaloneDeriving or AutoDeriveTypeable --------------------------------------------+------------------------------- Reporter: nwf | Owner: dreixel Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: fixed | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Difficulty: Unknown Testcase: deriving/should_compile/T7704 | Blockedby: Blocking: | Related: --------------------------------------------+------------------------------- Comment(by dreixel): Thanks for setting the testcase; I don't seem to be able to do that. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7704#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC