[commit: dph] master: Work around TH list comp (can be undone later) (e130689)
Ben Lippmeier
benl at ouroborus.net
Thu Jun 2 09:15:07 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/packages/dph
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/e130689d4178bc9d49a25e19f93b5660ffec0be7
>---------------------------------------------------------------
commit e130689d4178bc9d49a25e19f93b5660ffec0be7
Author: George Roldugin <groldugin at cse.unsw.edu.au>
Date: Tue May 31 14:45:53 2011 +1000
Work around TH list comp (can be undone later)
>---------------------------------------------------------------
examples/quickcheck/tests/Unlifted_Combinators.hs | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/examples/quickcheck/tests/Unlifted_Combinators.hs b/examples/quickcheck/tests/Unlifted_Combinators.hs
index 9b79c4b..34a537a 100644
--- a/examples/quickcheck/tests/Unlifted_Combinators.hs
+++ b/examples/quickcheck/tests/Unlifted_Combinators.hs
@@ -20,9 +20,10 @@ $(testcases [ "" <@ [t| ( Bool, Int ) |]
prop_pack :: (Eq a, Elt a) => Array a -> Array Bool -> Bool
prop_pack arr flags =
- toList (U.pack arr flags) == [x | (x,flag) <- P.zip arr' flags', flag]
- where arr' = toList arr
- flags' = toList flags
+ toList (U.pack arr flags) == pack (toList arr) (toList flags)
+ where pack (x : xs) (True : fs) = x : pack xs fs
+ pack (_ : xs) (False : fs) = pack xs fs
+ pack _ _ = []
prop_combine :: (Eq a, Elt a) => Array Bool -> Array a -> Array a -> Property
prop_combine sel arr brr =
More information about the Cvs-libraries
mailing list