#3707: deriving Data, Typeable for empty data decls
---------------------------------+------------------------------------------
Reporter: seanmcl | Owner:
Type: feature request | Status: new
Priority: normal | Component: Compiler
Version: 6.10.4 | Keywords:
Os: Unknown/Multiple | Testcase:
Architecture: Unknown/Multiple | Failure: None/Unknown
---------------------------------+------------------------------------------
Empty data decls are useful for things like phantom types. However,
deriving (Data, Typeable) does not work with them, so if you want to use
them with generics you must do something like the following:
data PredTag
instance Typeable PredTag where
typeOf _ = G.mkTyConApp (G.mkTyCon "PredTag") []
Surely GHC could derive this for us!
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3707>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs