summaryrefslogtreecommitdiff
path: root/compiler/typecheck/TcCanonical.lhs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2012-10-01 10:38:22 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2012-10-01 10:38:22 +0100
commit7fdcf2c755fde160d9fe5211cedc65d65fef68f1 (patch)
treeb40be13ad96ae5e7e374f07ca813d506eee54334 /compiler/typecheck/TcCanonical.lhs
parentadb6bcb7b85410dd42828a4824962ce9c6e9d667 (diff)
downloadhaskell-7fdcf2c755fde160d9fe5211cedc65d65fef68f1.tar.gz
Simplify the reOrient function (no change in behaviour)
Diffstat (limited to 'compiler/typecheck/TcCanonical.lhs')
-rw-r--r--compiler/typecheck/TcCanonical.lhs14
1 files changed, 5 insertions, 9 deletions
diff --git a/compiler/typecheck/TcCanonical.lhs b/compiler/typecheck/TcCanonical.lhs
index 826375bd02..18bfe2b416 100644
--- a/compiler/typecheck/TcCanonical.lhs
+++ b/compiler/typecheck/TcCanonical.lhs
@@ -1071,19 +1071,15 @@ reOrient :: CtEvidence -> TypeClassifier -> TypeClassifier -> Bool
-- We try to say False if possible, to minimise evidence generation
--
-- Postcondition: After re-orienting, first arg is not OTherCls
-reOrient _ev (OtherCls {}) (FunCls {}) = True
-reOrient _ev (OtherCls {}) (VarCls {}) = True
-reOrient _ev (OtherCls {}) (OtherCls {}) = panic "reOrient" -- One must be Var/Fun
+reOrient _ev (OtherCls {}) cls2 = ASSERT( case cls2 of { OtherCls {} -> False; _ -> True } )
+ True -- One must be Var/Fun
-reOrient _ev (FunCls {}) (VarCls _tv) = False
+reOrient _ev (FunCls {}) _ = False -- Fun/Other on rhs
-- But consider the following variation: isGiven ev && isMetaTyVar tv
-
-- See Note [No touchables as FunEq RHS] in TcSMonad
-reOrient _ev (FunCls {}) _ = False -- Fun/Other on rhs
-
-reOrient _ev (VarCls {}) (FunCls {}) = True
-reOrient _ev (VarCls {}) (OtherCls {}) = False
+reOrient _ev (VarCls {}) (FunCls {}) = True
+reOrient _ev (VarCls {}) (OtherCls {}) = False
reOrient _ev (VarCls tv1) (VarCls tv2)
| isMetaTyVar tv2 && not (isMetaTyVar tv1) = True
| otherwise = False