From: malcolm Date: Thu, 5 Feb 2004 11:58:21 +0000 (+0000) Subject: [project @ 2004-02-05 11:58:21 by malcolm] X-Git-Tag: nhc98-1-18-release~393 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=6f7021de17af64835e2dc00f13321f3ec691b5a0;p=haskell-directory.git [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. --- 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