Commit 45fd83bb authored by niteria's avatar niteria

Fix a typo in the note name in comments

This is `subsititution` to `substitution`, plus one instance of
the note that I missed.

Test Plan: docufix

Reviewers: simonpj, bgamari, austin, goldfire

Reviewed By: simonpj, bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1856

GHC Trac Issues: #11371
parent 44a5d51a
......@@ -788,7 +788,7 @@ lintTyApp fun_ty arg_ty
; in_scope <- getInScope
-- substTy needs the set of tyvars in scope to avoid generating
-- uniques that are already in scope.
-- See Note [The subsititution invariant] in TyCoRep
-- See Note [The substitution invariant] in TyCoRep
; return (substTyWithInScope in_scope [tv] [arg_ty] body_ty) }
| otherwise
......
......@@ -1416,7 +1416,7 @@ data TCvSubst
-- See Note [Apply Once]
-- and Note [Extending the TvSubstEnv]
-- and Note [Substituting types and coercions]
-- and Note [The subsititution invariant]
-- and Note [The substitution invariant]
-- | A substitution of 'Type's for 'TyVar's
-- and 'Kind's for 'KindVar's
......@@ -1489,7 +1489,7 @@ constructor) and the CvSubstEnv should *never* map a TyVar. Furthermore,
the range of the TvSubstEnv should *never* include a type headed with
CoercionTy.
Note [The subsititution invariant]
Note [The substitution invariant]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When calling substTy subst ty it should be the case that
the in-scope set in the substitution is a superset of both:
......@@ -1832,7 +1832,7 @@ substTyWithBinders bndrs tys = ASSERT( length bndrs == length tys )
-- | Substitute within a 'Type' after adding the free variables of the type
-- to the in-scope set. This is useful for the case when the free variables
-- aren't already in the in-scope set or easily available.
-- See also Note [The subsititution invariant].
-- See also Note [The substitution invariant].
substTyAddInScope :: TCvSubst -> Type -> Type
substTyAddInScope subst ty =
substTy (extendTCvInScopeSet subst $ tyCoVarsOfType ty) ty
......@@ -1840,7 +1840,7 @@ substTyAddInScope subst ty =
-- | When calling `substTy` it should be the case that the in-scope set in
-- the substitution is a superset of the free vars of the range of the
-- substitution.
-- See also Note [The subsititution invariant].
-- See also Note [The substitution invariant].
isValidTCvSubst :: TCvSubst -> Bool
isValidTCvSubst (TCvSubst in_scope tenv cenv) =
(tenvFVs `varSetInScope` in_scope) &&
......@@ -1851,7 +1851,7 @@ isValidTCvSubst (TCvSubst in_scope tenv cenv) =
-- | Substitute within a 'Type'
-- The substitution has to satisfy the invariants described in
-- Note [The subsititution invariant].
-- Note [The substitution invariant].
substTy ::
-- CallStack wasn't present in GHC 7.10.1, disable callstacks in stage 1
......@@ -1880,7 +1880,7 @@ substTy subst@(TCvSubst in_scope tenv cenv) ty
-- | Substitute within a 'Type' disabling the sanity checks.
-- The problems that the sanity checks in substTy catch are described in
-- Note [The subsititution invariant].
-- Note [The substitution invariant].
-- The goal of #11371 is to migrate all the calls of substTyUnchecked to
-- substTy and remove this function. Please don't use in new code.
substTyUnchecked :: TCvSubst -> Type -> Type
......
......@@ -297,8 +297,7 @@ coreView (TyConApp tc tys) | Just (tenv, rhs, tys') <- expandSynTyCon_maybe tc t
= Just (mkAppTys (substTy (mkTopTCvSubst tenv) rhs) tys')
-- The free vars of 'rhs' should all be bound by 'tenv', so it's
-- ok to use 'substTy' here.
-- See also Note [Generating the in-scope set for a substitution]
-- in TyCoRep.
-- See also Note [The substitution invariant] in TyCoRep.
-- Its important to use mkAppTys, rather than (foldl AppTy),
-- because the function part might well return a
-- partially-applied type constructor; indeed, usually will!
......
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