[commit: ghc] supercompiler: Made pairT lazier (021214f)

Max Bolingbroke <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/021214f87371dfa1c1e1f65e4b6e494333e37bb9

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

commit 021214f87371dfa1c1e1f65e4b6e494333e37bb9
Author: Max Bolingbroke <[email protected]>
Date:   Fri Oct 19 12:48:48 2012 +0100

    Made pairT lazier

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

 .../Supercompile/Termination/Combinators.hs        |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/compiler/supercompile/Supercompile/Termination/Combinators.hs b/compiler/supercompile/Supercompile/Termination/Combinators.hs
index 80c8fcb..d7639ac 100644
--- a/compiler/supercompile/Supercompile/Termination/Combinators.hs
+++ b/compiler/supercompile/Supercompile/Termination/Combinators.hs
@@ -111,9 +111,10 @@ pairT :: TTest a -> TTest b -> TTest (a, b)
 pairT (WQO prepare_a embed_a) (WQO prepare_b embed_b) = WQO (prepare_a *** prepare_b) go
   where go (a1, b1) (a2, b2) = zipPair ((&&), (&&)) (a1 `embed_a` a2) (b1 `embed_b` b2)
 
+-- NB: zipPair is lazy in the second pair so that when f/g are (&&) we can doing some evaluation
 zipPair :: (a -> b -> c, d -> e -> f)
         -> (a, d) -> (b, e) -> (c, f)
-zipPair (f, g) (a, d) (b, e) = (f a b, g d e)
+zipPair (f, g) (a, d) ~(b, e) = (f a b, g d e)
 
 -- | Type class of zippable things. Instances should satisfy the laws:
 --
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.