[commit: ghc] ghc-kinds: Fix use of decomposeCo in Simplify; fixes a Lint error (7c2d9a8)
Simon Peyton Jones
simonpj at microsoft.com
Mon Nov 7 16:13:20 CET 2011
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : ghc-kinds
http://hackage.haskell.org/trac/ghc/changeset/7c2d9a8f3ccba8d095b807a22937171d61339495
>---------------------------------------------------------------
commit 7c2d9a8f3ccba8d095b807a22937171d61339495
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Mon Nov 7 08:25:40 2011 +0000
Fix use of decomposeCo in Simplify; fixes a Lint error
>---------------------------------------------------------------
compiler/simplCore/Simplify.lhs | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/compiler/simplCore/Simplify.lhs b/compiler/simplCore/Simplify.lhs
index 853815c..4bb20fa 100644
--- a/compiler/simplCore/Simplify.lhs
+++ b/compiler/simplCore/Simplify.lhs
@@ -980,8 +980,13 @@ simplCoercionF env co cont
simpl_co co (CoerceIt g cont)
= simpl_co new_co cont
where
- new_co = mkSymCo g0 `mkTransCo` co `mkTransCo` g1
- [g0, g1] = decomposeCo 2 g
+ -- g :: (s1 ~# s2) ~# (t1 ~# t2)
+ -- g1 :: s1 ~# t1
+ -- g2 :: s2 ~# t2
+ new_co = mkSymCo g1 `mkTransCo` co `mkTransCo` g2
+ [_reflk, g1, g2] = decomposeCo 3 g
+ -- Remember, (~#) :: forall k. k -> k -> *
+ -- so it takes *three* arguments, not two
simpl_co co cont
= seqCo co `seq` rebuild env (Coercion co) cont
More information about the Cvs-ghc
mailing list