summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2016-03-29 09:57:06 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2016-03-31 08:02:29 +0100
commit8f66bac9ba4c3ebe6c26b0c72e03b6754782ecbe (patch)
treede46ce2a17ec085aef6c88e2ee5a8e2a1483b30a
parent24d761531cfc18152598becc0aeb90376fd19198 (diff)
downloadhaskell-8f66bac9ba4c3ebe6c26b0c72e03b6754782ecbe.tar.gz
Comments only
-rw-r--r--compiler/basicTypes/DataCon.hs16
-rw-r--r--compiler/typecheck/TcSimplify.hs2
2 files changed, 8 insertions, 10 deletions
diff --git a/compiler/basicTypes/DataCon.hs b/compiler/basicTypes/DataCon.hs
index 1e4af2d475..9a754dd423 100644
--- a/compiler/basicTypes/DataCon.hs
+++ b/compiler/basicTypes/DataCon.hs
@@ -291,10 +291,9 @@ data DataCon
-- dcRepTyCon = T
-- 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
- -- the same number of type variables!
- -- [This is a change (Oct05): previously, vanilla datacons guaranteed to
- -- have the same type variables as their parent TyCon, but that seems ugly.]
+ -- FOR THE PARENT TyCon. (This is a change (Oct05): previously, vanilla
+ -- datacons guaranteed to have the same type variables as their parent TyCon,
+ -- but that seems ugly.)
dcVanilla :: Bool, -- True <=> This is a vanilla Haskell 98 data constructor
-- Its type is of form
@@ -307,12 +306,11 @@ data DataCon
-- The declaration format is held in the TyCon (algTcGadtSyntax)
-- 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
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]
dcExTyVars :: [TyVar], -- Two linked fields
@@ -441,8 +439,8 @@ Specifically:
the corresponding tyvar in the TyVars list.
* Each Visibilty flag (va, vb, etc) is Invisible or Specified.
- None are Visible. (See Note [No Visible TyBinder in terms];
- a DataCon is a term-level function.)
+ None are Visible. (A DataCon is a term-level function; see
+ Note [No Visible TyBinder in terms] in TyCoRep.)
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
diff --git a/compiler/typecheck/TcSimplify.hs b/compiler/typecheck/TcSimplify.hs
index 51a35884ef..3adb77eb9d 100644
--- a/compiler/typecheck/TcSimplify.hs
+++ b/compiler/typecheck/TcSimplify.hs
@@ -768,7 +768,7 @@ decideQuantification apply_mr sigs name_taus constraints
-- to *. So, don't grow the kvs.
; constraints <- TcM.zonkTcTypes constraints
- -- quantiyTyVars turned some meta tyvars into
+ -- quantifyTyVars turned some meta tyvars into
-- quantified skolems, so we have to zonk again
; let theta = pickQuantifiablePreds (mkVarSet qtvs) constraints