[commit: ghc] master: Minor code cleanup (53c1374)

git at git.haskell.org git at git.haskell.org
Fri Jun 5 15:09:22 UTC 2015


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/53c13744210402151e58baf0d703d23927f5188d/ghc

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

commit 53c13744210402151e58baf0d703d23927f5188d
Author: Richard Eisenberg <eir at cis.upenn.edu>
Date:   Fri Jun 5 09:50:00 2015 -0400

    Minor code cleanup


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

53c13744210402151e58baf0d703d23927f5188d
 compiler/typecheck/TcCanonical.hs | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/compiler/typecheck/TcCanonical.hs b/compiler/typecheck/TcCanonical.hs
index 1223194..5bbab21 100644
--- a/compiler/typecheck/TcCanonical.hs
+++ b/compiler/typecheck/TcCanonical.hs
@@ -432,7 +432,7 @@ can_eq_nc' flat _rdr_env _envs ev eq_rel ty1 ps_ty1 ty2 ps_ty2
   | Just ty2' <- tcView ty2 = can_eq_nc flat ev eq_rel ty1  ps_ty1 ty2' ps_ty2
 
 -- need to check for reflexivity in the ReprEq case.
--- See Note [AppTy reflexivity check] and Note [Eager reflexivity check]
+-- See Note [Eager reflexivity check]
 can_eq_nc' _flat _rdr_env _envs ev ReprEq ty1 _ ty2 _
   | ty1 `eqType` ty2
   = canEqReflexive ev ReprEq ty1
@@ -509,11 +509,6 @@ can_eq_nc' True _rdr_env _envs ev NomEq ty1 _ (AppTy t2 s2) _
   | Just (t1, s1) <- tcSplitAppTy_maybe ty1
   = can_eq_app ev t1 s1 t2 s2
 
--- See Note [AppTy reflexivity check]
-can_eq_nc' _flat _rdr_env _envs ev ReprEq ty1@(AppTy {}) _ ty2@(AppTy {}) _
-  | ty1 `eqType` ty2
-  = canEqReflexive ev ReprEq ty1
-
 -- No similarity in type structure detected. Flatten and try again!
 can_eq_nc' False rdr_env envs ev eq_rel _ ps_ty1 _ ps_ty2
   = do { (xi1, co1) <- flatten FM_FlattenAll ev ps_ty1
@@ -571,8 +566,7 @@ equality because the flattener technology deals with the similar case
 Note that this check does not catch all cases, but it will catch the cases
 we're most worried about, types like X above that are actually inhabited.
 
-Note [AppTy reflexivity check]
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Here's another place where this reflexivity check is key:
 Consider trying to prove (f a) ~R (f a). The AppTys in there can't
 be decomposed, because representational equality isn't congruent with respect
 to AppTy. So, when canonicalising the equality above, we get stuck and



More information about the ghc-commits mailing list