[commit: ghc] master: Minor improvements to comments [skip ci] (5d3eb64)

git at git.haskell.org git at git.haskell.org
Fri Aug 31 02:46:18 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/5d3eb646b08433587aa38694afcaee6863160e40/ghc

>---------------------------------------------------------------

commit 5d3eb646b08433587aa38694afcaee6863160e40
Author: Richard Eisenberg <rae at cs.brynmawr.edu>
Date:   Thu Aug 30 22:33:40 2018 -0400

    Minor improvements to comments [skip ci]


>---------------------------------------------------------------

5d3eb646b08433587aa38694afcaee6863160e40
 compiler/typecheck/TcHsType.hs | 12 +++++++-----
 compiler/types/FamInstEnv.hs   |  6 ------
 2 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/compiler/typecheck/TcHsType.hs b/compiler/typecheck/TcHsType.hs
index a70db2e..65c97da 100644
--- a/compiler/typecheck/TcHsType.hs
+++ b/compiler/typecheck/TcHsType.hs
@@ -1464,7 +1464,7 @@ kind-generalize correctly.
 
 In Step 4, we have to deal with the fact that metatyvars generated
 in the type may have a bumped TcLevel, because explicit foralls
-raise the TcLevel. To avoid these variables from every being visible
+raise the TcLevel. To avoid these variables from ever being visible
 in the surrounding context, we must obey the following dictum:
 
   Every metavariable in a type must either be
@@ -1476,18 +1476,20 @@ has a proper TcLevel. (I'm ignoring the TcLevel on a skolem here, as
 it's not really in play here.) On the other hand, if it is not
 generalized (because we're not generalizing the construct -- e.g., pattern
 sig -- or because the metavars are constrained -- see kindGeneralizeLocal)
-we need to promote to (MetaTvInv) of Note [TcLevel and untouchable type variables]
+we need to promote to maintain (MetaTvInv) of Note [TcLevel and untouchable type variables]
 in TcType.
 
 After promoting/generalizing, we need to zonk *again* because both
 promoting and generalizing fill in metavariables.
 
 To avoid the double-zonk, we do two things:
- 1. zonkPromoteType and friends zonk and promote at the same time.
-    Accordingly, the function does setps 3-5 all at once, preventing
+ 1. When we're not generalizing:
+    zonkPromoteType and friends zonk and promote at the same time.
+    Accordingly, the function does steps 3-5 all at once, preventing
     the need for multiple traversals.
 
- 2. kindGeneralize does not require a zonked type -- it zonks as it
+ 2. When we are generalizing:
+    kindGeneralize does not require a zonked type -- it zonks as it
     gathers free variables. So this way effectively sidesteps step 3.
 
 -}
diff --git a/compiler/types/FamInstEnv.hs b/compiler/types/FamInstEnv.hs
index a59f9a6..636c0da 100644
--- a/compiler/types/FamInstEnv.hs
+++ b/compiler/types/FamInstEnv.hs
@@ -1273,12 +1273,6 @@ topNormaliseType_maybe env ty
 
     tyFamStepper rec_nts tc tys  -- Try to step a type/data family
       = let (args_co, ntys) = normaliseTcArgs env Representational tc tys in
-          -- NB: It's OK to use normaliseTcArgs here instead of
-          -- normalise_tc_args (which takes the LiftingContext described
-          -- in Note [Normalising types]) because the reduceTyFamApp below
-          -- works only at top level. We'll never recur in this function
-          -- after reducing the kind of a bound tyvar.
-
         case reduceTyFamApp_maybe env Representational tc ntys of
           Just (co, rhs) -> NS_Step rec_nts rhs (args_co `mkTransCo` co)
           _              -> NS_Done



More information about the ghc-commits mailing list