From 6f7021de17af64835e2dc00f13321f3ec691b5a0 Mon Sep 17 00:00:00 2001 From: malcolm Date: Thu, 5 Feb 2004 11:58:21 +0000 Subject: [PATCH] [project @ 2004-02-05 11:58:21 by malcolm] Fix definition of 'partition' to match the (non-)strictness mandated by the Haskell'98 Libraries Report version. --- Data/List.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Data/List.hs b/Data/List.hs index 48b1ae1..5b8d767 100644 --- a/Data/List.hs +++ b/Data/List.hs @@ -404,8 +404,8 @@ partition :: (a -> Bool) -> [a] -> ([a],[a]) {-# INLINE partition #-} partition p xs = foldr (select p) ([],[]) xs -select p x (ts,fs) | p x = (x:ts,fs) - | otherwise = (ts, x:fs) +select p x ~(ts,fs) | p x = (x:ts,fs) + | otherwise = (ts, x:fs) -- | The 'mapAccumL' function behaves like a combination of 'map' and -- 'foldl'; it applies a function to each element of a list, passing -- 1.7.10.4