X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=compiler%2FbasicTypes%2FDataCon.lhs;h=8f09078055cfbc818363e3f008f17ddcf6a515c1;hb=d436c70d43fb905c63220040168295e473f4b90a;hp=af30dd1853d5a8c58446a3da594f40e233da017d;hpb=3517c53d8a66149dcc3f971cf0577719e99d6d70;p=ghc-hetmet.git diff --git a/compiler/basicTypes/DataCon.lhs b/compiler/basicTypes/DataCon.lhs index af30dd1..8f09078 100644 --- a/compiler/basicTypes/DataCon.lhs +++ b/compiler/basicTypes/DataCon.lhs @@ -51,7 +51,6 @@ import Outputable import Unique import ListSetOps import Util -import Maybes import FastString import Module @@ -98,12 +97,12 @@ Note [Data Constructor Naming] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Each data constructor C has two, and possibly up to four, Names associated with it: - OccName Name space Name of - --------------------------------------------------------------------------- - * The "data con itself" C DataName DataCon - * The "worker data con" C VarName Id (the worker) - * The "wrapper data con" \$WC VarName Id (the wrapper) - * The "newtype coercion" :CoT TcClsName TyCon + OccName Name space Name of Notes + --------------------------------------------------------------------------- + The "data con itself" C DataName DataCon In dom( GlobalRdrEnv ) + The "worker data con" C VarName Id The worker + The "wrapper data con" $WC VarName Id The wrapper + The "newtype coercion" :CoT TcClsName TyCon EVERY data constructor (incl for newtypes) has the former two (the data con itself, and its worker. But only some data constructors have a @@ -271,8 +270,9 @@ data DataCon -- syntax, provided its type looks like the above. -- The declaration format is held in the TyCon (algTcGadtSyntax) - dcUnivTyVars :: [TyVar], -- Universally-quantified type vars + dcUnivTyVars :: [TyVar], -- Universally-quantified type vars [a,b,c] -- INVARIANT: length matches arity of the dcRepTyCon + --- result type of (rep) data con is exactly (T a b c) dcExTyVars :: [TyVar], -- Existentially-quantified type vars -- In general, the dcUnivTyVars are NOT NECESSARILY THE SAME AS THE TYVARS