Commit ef0ef4cc authored by's avatar
Browse files

Fix worker/wrapper ids for newtype instances

- 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).
parent 39dca315
......@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment