From: Malcolm.Wallace@cs.york.ac.uk Date: Wed, 2 Dec 2009 03:28:07 +0000 (+0000) Subject: Data.Either.partitionEithers was insufficiently lazy. X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=1e6808d17721a45bb770c1d68a3209f60f636dab;p=ghc-base.git Data.Either.partitionEithers was insufficiently lazy. Spotted by Daniel Fischer. --- diff --git a/Data/Either.hs b/Data/Either.hs index 6af488f..fd6651f 100644 --- a/Data/Either.hs +++ b/Data/Either.hs @@ -79,8 +79,8 @@ rights x = [a | Right a <- x] partitionEithers :: [Either a b] -> ([a],[b]) partitionEithers = foldr (either left right) ([],[]) where - left a (l, r) = (a:l, r) - right a (l, r) = (l, a:r) + left a ~(l, r) = (a:l, r) + right a ~(l, r) = (l, a:r) {- {--------------------------------------------------------------------