Changes between Initial Version and Version 1 of Ticket #3707


Ignore:
Timestamp:
Dec 2, 2009 10:08:46 AM (4 years ago)
Author:
simonpj
Comment:

When you say it "does not work" can you supply a test case? I tried this:

{-# LANGUAGE EmptyDataDecls, DeriveDataTypeable #-}

module T3707 where

import Data.Typeable

data PredType deriving( Typeable )

That works fine in GHC 6.10 and the HEAD.

You do get a complaint if you derive 'Data' for such a type, but I'm not sure that makes sense.

I'll close this ticket, but please re-open if I have missed something.

Simon

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #3707

    • Property Status changed from new to closed
    • Property Resolution changed from to invalid
  • Ticket #3707 – Description

    initial v1  
    11Empty 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: 
    2  
     2{{{ 
    33data PredTag  
    44 
    55instance Typeable PredTag where 
    66  typeOf _ = G.mkTyConApp (G.mkTyCon "PredTag") [] 
    7  
     7}}} 
    88Surely GHC could derive this for us! 
    99