[commit: ghc] master: Add a couple of missing cases to isTcReflCo and isTcReflCo_maybe (3e96d89)
git at git.haskell.org
git at git.haskell.org
Tue Dec 23 16:29:35 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/3e96d89b1d37a989b92a11587de29e347ef19328/ghc
>---------------------------------------------------------------
commit 3e96d89b1d37a989b92a11587de29e347ef19328
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Tue Dec 23 15:40:54 2014 +0000
Add a couple of missing cases to isTcReflCo and isTcReflCo_maybe
>---------------------------------------------------------------
3e96d89b1d37a989b92a11587de29e347ef19328
compiler/typecheck/TcEvidence.hs | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/compiler/typecheck/TcEvidence.hs b/compiler/typecheck/TcEvidence.hs
index 60ac889..552a403 100644
--- a/compiler/typecheck/TcEvidence.hs
+++ b/compiler/typecheck/TcEvidence.hs
@@ -157,12 +157,14 @@ isEqVar v = case tyConAppTyCon_maybe (varType v) of
Nothing -> False
isTcReflCo_maybe :: TcCoercion -> Maybe TcType
-isTcReflCo_maybe (TcRefl _ ty) = Just ty
-isTcReflCo_maybe _ = Nothing
+isTcReflCo_maybe (TcRefl _ ty) = Just ty
+isTcReflCo_maybe (TcCoercion co) = isReflCo_maybe co
+isTcReflCo_maybe _ = Nothing
isTcReflCo :: TcCoercion -> Bool
-isTcReflCo (TcRefl {}) = True
-isTcReflCo _ = False
+isTcReflCo (TcRefl {}) = True
+isTcReflCo (TcCoercion co) = isReflCo co
+isTcReflCo _ = False
getTcCoVar_maybe :: TcCoercion -> Maybe CoVar
getTcCoVar_maybe (TcCoVarCo v) = Just v
More information about the ghc-commits
mailing list