[commit: ghc] master: Comments only (0f5a63e)

git at git.haskell.org git at git.haskell.org
Wed Jul 25 11:26:13 UTC 2018


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/0f5a63e3d763f18c683f076e0e96396166863f56/ghc

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

commit 0f5a63e3d763f18c683f076e0e96396166863f56
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Wed Jul 25 12:03:43 2018 +0100

    Comments only


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

0f5a63e3d763f18c683f076e0e96396166863f56
 compiler/typecheck/TcSimplify.hs | 30 ++++++++++++++++++------------
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/compiler/typecheck/TcSimplify.hs b/compiler/typecheck/TcSimplify.hs
index 97da3dc..5856c0f 100644
--- a/compiler/typecheck/TcSimplify.hs
+++ b/compiler/typecheck/TcSimplify.hs
@@ -2309,24 +2309,30 @@ Note [Which equalities to float]
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Which equalities should we float?  We want to float ones where there
 is a decent chance that floating outwards will allow unification to
-happen.  In particular:
-
-   Float out homogeneous equalities of form (alpha ~ ty) or (ty ~ alpha), where
+happen.  In particular, float out equalities that are:
 
+* Of form (alpha ~# ty) or (ty ~# alpha), where
    * alpha is a meta-tyvar.
-
    * And 'alpha' is not a SigTv with 'ty' being a non-tyvar.  In that
      case, floating out won't help either, and it may affect grouping
      of error messages.
 
-Why homogeneous (i.e., the kinds of the types are the same)? Because heterogeneous
-equalities have derived kind equalities. See Note [Equalities with incompatible kinds]
-in TcCanonical. If we float out a hetero equality, then it will spit out the
-same derived kind equality again, which might create duplicate error messages.
-Instead, we do float out the kind equality (if it's worth floating out, as
-above). If/when we solve it, we'll be able to rewrite the original hetero equality
-to be homogeneous, and then perhaps make progress / float it out. The duplicate
-error message was spotted in typecheck/should_fail/T7368.
+* Homogeneous (both sides have the same kind). Why only homogeneous?
+  Because heterogeneous equalities have derived kind equalities.
+  See Note [Equalities with incompatible kinds] in TcCanonical.
+  If we float out a hetero equality, then it will spit out the same
+  derived kind equality again, which might create duplicate error
+  messages.
+
+  Instead, we do float out the kind equality (if it's worth floating
+  out, as above). If/when we solve it, we'll be able to rewrite the
+  original hetero equality to be homogeneous, and then perhaps make
+  progress / float it out. The duplicate error message was spotted in
+  typecheck/should_fail/T7368.
+
+* Nominal.  No point in floating (alpha ~R# ty), because we do not
+  unify representational equalities even if alpha is touchable.
+  See Note [Do not unify representational equalities] in TcInteract.
 
 Note [Skolem escape]
 ~~~~~~~~~~~~~~~~~~~~



More information about the ghc-commits mailing list