Fix worker/wrapper ids for newtype instances
authorManuel M T Chakravarty <chak@cse.unsw.edu.au>
Fri, 8 Jun 2007 06:10:46 +0000 (06:10 +0000)
committerManuel M T Chakravarty <chak@cse.unsw.edu.au>
Fri, 8 Jun 2007 06:10:46 +0000 (06:10 +0000)
- mkDataConIds forced an algebraic worker/wrapper on newtype instances (not
  on vanilla newtypes).  I am not sure where this came from (from code I
  wrote or from the recent restructuring of MkIds), but its not the right
  thing to do.  In particular, it requires newtype instances to have con_info
  labels in the generated code, which makes no sense.
- Worker construction for newtypes is smart enough that it will construct the
  right signature for newtype instances (ie, one that mentions the family
  type constructor, not the instance tycon).

compiler/basicTypes/MkId.lhs

index 403d309..535faef 100644 (file)
@@ -211,7 +211,6 @@ Now we want
 mkDataConIds :: Name -> Name -> DataCon -> DataConIds
 mkDataConIds wrap_name wkr_name data_con
   | isNewTyCon tycon                   -- Newtype, only has a worker
-  , not (isFamInstTyCon tycon)         -- unless it's a family instancex
   = DCIds Nothing nt_work_id                 
 
   | any isMarkedStrict all_strict_marks             -- Algebraic, needs wrapper