X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fdocs%2Fcomm%2Fthe-beast%2Fvars.html;h=9bbd310c605a66c2b5ed0db6ca7f1a71018c009d;hb=61ccfec175e1f51b2c89559faf91d9bee0b3b601;hp=c2c1ce0de90cf227ec03f89afcf836e844777ae7;hpb=057e3f0d571845f91178cb0e416566e063696425;p=ghc-hetmet.git
diff --git a/ghc/docs/comm/the-beast/vars.html b/ghc/docs/comm/the-beast/vars.html
index c2c1ce0..9bbd310 100644
--- a/ghc/docs/comm/the-beast/vars.html
+++ b/ghc/docs/comm/the-beast/vars.html
@@ -73,21 +73,28 @@ data VarDetails
| TyVar
| MutTyVar (IORef (Maybe Type)) -- Used during unification;
- Bool -- True <=> this is a type signature variable, which
- -- should not be unified with a non-tyvar type
+ TyVarDetails
Type variables (
TyVar
)
-The TyVar
case is self-explanatory. The
-MutTyVar
case is used only during type checking. Then a
-type variable can be unified, using an imperative update, with a type,
-and that is what the IORef
is for. The Bool
-field records whether the type variable arose from a type signature,
-in which case it should not be unified with a type (only with another
-type variable).
+The TyVar
case is self-explanatory. The MutTyVar
+case is used only during type checking. Then a type variable can be unified,
+using an imperative update, with a type, and that is what the
+IORef
is for. The TcType.TyVarDetails
field records
+the sort of type variable we are dealing with. It is defined as
+
+data TyVarDetails = SigTv | ClsTv | InstTv | VanillaTv ++
SigTv
marks type variables that were introduced when
+instantiating a type signature prior to matching it against the inferred type
+of a definition. The variants ClsTv
and InstTv
mark
+scoped type variables introduced by class and instance heads, respectively.
+These first three sorts of type variables are skolem variables (tested by the
+predicate isSkolemTyVar
); i.e., they must not be
+instantiated. All other type variables are marked as VanillaTv
.
For a long time I tried to keep mutable Vars statically type-distinct
from immutable Vars, but I've finally given up. It's just too painful.
@@ -220,7 +227,7 @@ not the same as whether the Id has an ExternaName
or an Inter
-Last modified: Tue Nov 13 14:11:35 EST 2001
+Last modified: Fri Sep 12 15:17:18 BST 2003