[commit: ghc] wip/improve-pext-pdep: Fix some typos, etc., in comments. (7fcd680)
git at git.haskell.org
git at git.haskell.org
Sun Jan 6 09:26:33 UTC 2019
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/improve-pext-pdep
Link : http://ghc.haskell.org/trac/ghc/changeset/7fcd6808d73178f76e1b4d5d11d2abdd9aca5591/ghc
>---------------------------------------------------------------
commit 7fcd6808d73178f76e1b4d5d11d2abdd9aca5591
Author: Richard Eisenberg <rae at cs.brynmawr.edu>
Date: Thu Jan 3 19:02:10 2019 -0500
Fix some typos, etc., in comments.
[ci skip]
>---------------------------------------------------------------
7fcd6808d73178f76e1b4d5d11d2abdd9aca5591
compiler/types/CoAxiom.hs | 2 +-
compiler/types/FamInstEnv.hs | 13 ++++++++-----
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/compiler/types/CoAxiom.hs b/compiler/types/CoAxiom.hs
index 5c4237c..112ab27 100644
--- a/compiler/types/CoAxiom.hs
+++ b/compiler/types/CoAxiom.hs
@@ -223,7 +223,7 @@ data CoAxBranch
, cab_tvs :: [TyVar] -- Bound type variables; not necessarily fresh
, cab_eta_tvs :: [TyVar] -- Eta-reduced tyvars
-- See Note [CoAxBranch type variables]
- -- cab_tvs and cab_lhsmay be eta-reduded; see FamInstEnv
+ -- cab_tvs and cab_lhs may be eta-reduded; see
-- Note [Eta reduction for data families]
, cab_cvs :: [CoVar] -- Bound coercion variables
-- Always empty, for now.
diff --git a/compiler/types/FamInstEnv.hs b/compiler/types/FamInstEnv.hs
index c6dcab6..d721ad2 100644
--- a/compiler/types/FamInstEnv.hs
+++ b/compiler/types/FamInstEnv.hs
@@ -615,10 +615,11 @@ If we're not careful during tidying, then when this program is compiled with
axiom DataFamilyInstanceLHS.D:R:SingMyKind_0 ::
Sing _ = DataFamilyInstanceLHS.R:SingMyKind_ _
-Its misleading to have a wildcard type appearing on the RHS like
-that. To avoid this issue, during tidying, we always opt to add a
-numeric suffix to types that are simply `_`. That way, you instead end
-up with:
+It's misleading to have a wildcard type appearing on the RHS like
+that. To avoid this issue, when building a CoAxiom (which is what eventually
+gets printed above), we tidy all the variables in an env that already contains
+'_'. Thus, any variable named '_' will be renamed, giving us the nicer output
+here:
COERCION AXIOMS
axiom DataFamilyInstanceLHS.D:R:SingMyKind_0 ::
@@ -626,7 +627,9 @@ up with:
Which is at least legal syntax.
-See also Note [CoAxBranch type variables] in CoAxiom
+See also Note [CoAxBranch type variables] in CoAxiom; note that we
+are tidying (changing OccNames only), not freshening, in accordance with
+that Note.
-}
-- all axiom roles are Nominal, as this is only used with type families
More information about the ghc-commits
mailing list