Commit 7c122851 authored by Simon Peyton Jones's avatar Simon Peyton Jones Committed by Ben Gamari

Comments only

parent 5541b87c
......@@ -67,6 +67,31 @@ import Panic
%************************************************************************
-}
{- Note [Shallow and deep free variables]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Definitions
* Shallow free variables of a type: the variables
affected by substitution. Specifically, the (TyVarTy tv)
and (CoVar cv) that appear
- In the type and coercions appearing in the type
- In shallow free variables of the kind of a Forall binder
but NOT in the kind of the /occurrences/ of a type variable.
* Deep free variables of a type: shallow free variables, plus
the deep free variables of the kinds of those variables.
That is, deepFVs( t ) = closeOverKinds( shallowFVs( t ) )
Examples:
Type Shallow Deep
---------------------------------
(a : (k:Type)) {a} {a,k}
forall (a:(k:Type)). a {k} {k}
(a:k->Type) (b:k) {a,b} {a,b,k}
-}
{- Note [Free variables of types]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The family of functions tyCoVarsOfType, tyCoVarsOfTypes etc, returns
......@@ -247,6 +272,7 @@ noView _ = Nothing
{- *********************************************************************
* *
Deep free variables
See Note [Shallow and deep free variables]
* *
********************************************************************* -}
......@@ -293,9 +319,11 @@ deepTcvFolder = TyCoFolder { tcf_view = noView
{- *********************************************************************
* *
Shallow free variables
See Note [Shallow and deep free variables]
* *
********************************************************************* -}
shallowTyCoVarsOfType :: Type -> TyCoVarSet
-- See Note [Free variables of types]
shallowTyCoVarsOfType ty = runTyCoVars (shallow_ty ty)
......
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