Commit 8f66bac9 authored by Simon Peyton Jones's avatar Simon Peyton Jones

Comments only

parent 24d76153
...@@ -291,10 +291,9 @@ data DataCon ...@@ -291,10 +291,9 @@ data DataCon
-- dcRepTyCon = T -- dcRepTyCon = T
-- In general, the dcUnivTyVars are NOT NECESSARILY THE SAME AS THE TYVARS -- In general, the dcUnivTyVars are NOT NECESSARILY THE SAME AS THE TYVARS
-- FOR THE PARENT TyCon. With GADTs the data con might not even have -- FOR THE PARENT TyCon. (This is a change (Oct05): previously, vanilla
-- the same number of type variables! -- datacons guaranteed to have the same type variables as their parent TyCon,
-- [This is a change (Oct05): previously, vanilla datacons guaranteed to -- but that seems ugly.)
-- have the same type variables as their parent TyCon, but that seems ugly.]
dcVanilla :: Bool, -- True <=> This is a vanilla Haskell 98 data constructor dcVanilla :: Bool, -- True <=> This is a vanilla Haskell 98 data constructor
-- Its type is of form -- Its type is of form
...@@ -307,12 +306,11 @@ data DataCon ...@@ -307,12 +306,11 @@ data DataCon
-- The declaration format is held in the TyCon (algTcGadtSyntax) -- The declaration format is held in the TyCon (algTcGadtSyntax)
-- Universally-quantified type vars [a,b,c] -- Universally-quantified type vars [a,b,c]
-- INVARIANT: length matches arity of the dcRepTyCon
-- INVARIANT: result type of data con worker is exactly (T a b c)
dcUnivTyVars :: [TyVar], -- Two linked fields dcUnivTyVars :: [TyVar], -- Two linked fields
dcUnivTyBinders :: [TyBinder], -- see Note [TyBinders in DataCons] dcUnivTyBinders :: [TyBinder], -- see Note [TyBinders in DataCons]
-- INVARIANT: length matches arity of the dcRepTyCon
--
-- INFARIANT: result type of (rep) data con is exactly (T a b c)
-- Existentially-quantified type vars [x,y] -- Existentially-quantified type vars [x,y]
dcExTyVars :: [TyVar], -- Two linked fields dcExTyVars :: [TyVar], -- Two linked fields
...@@ -441,8 +439,8 @@ Specifically: ...@@ -441,8 +439,8 @@ Specifically:
the corresponding tyvar in the TyVars list. the corresponding tyvar in the TyVars list.
* Each Visibilty flag (va, vb, etc) is Invisible or Specified. * Each Visibilty flag (va, vb, etc) is Invisible or Specified.
None are Visible. (See Note [No Visible TyBinder in terms]; None are Visible. (A DataCon is a term-level function; see
a DataCon is a term-level function.) Note [No Visible TyBinder in terms] in TyCoRep.)
Why store these fields redundantly? Purely convenience. In most Why store these fields redundantly? Purely convenience. In most
places in GHC, it's just the TyVars that are needed, so that's what's places in GHC, it's just the TyVars that are needed, so that's what's
......
...@@ -768,7 +768,7 @@ decideQuantification apply_mr sigs name_taus constraints ...@@ -768,7 +768,7 @@ decideQuantification apply_mr sigs name_taus constraints
-- to *. So, don't grow the kvs. -- to *. So, don't grow the kvs.
; constraints <- TcM.zonkTcTypes constraints ; constraints <- TcM.zonkTcTypes constraints
-- quantiyTyVars turned some meta tyvars into -- quantifyTyVars turned some meta tyvars into
-- quantified skolems, so we have to zonk again -- quantified skolems, so we have to zonk again
; let theta = pickQuantifiablePreds (mkVarSet qtvs) constraints ; let theta = pickQuantifiablePreds (mkVarSet qtvs) constraints
......
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