diff options
-rw-r--r-- | libraries/base/Data/OldList.hs | 2 | ||||
-rw-r--r-- | libraries/base/GHC/List.hs | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/libraries/base/Data/OldList.hs b/libraries/base/Data/OldList.hs index 8e610ebba0..a2f2950cb9 100644 --- a/libraries/base/Data/OldList.hs +++ b/libraries/base/Data/OldList.hs @@ -1615,7 +1615,7 @@ lines "" = [] -- so s' keeps a reference to the first line via the pair and we have -- a space leak (cf. #4334). -- So we need to make GHC see the selector thunks with a trick. -lines s = cons (case break (== '\n') s of +lines s = cons (case break_ (== '\n') s of (l, s') -> (l, case s' of [] -> [] _:s'' -> lines s'')) diff --git a/libraries/base/GHC/List.hs b/libraries/base/GHC/List.hs index e5c4878ea1..6d393adf99 100644 --- a/libraries/base/GHC/List.hs +++ b/libraries/base/GHC/List.hs @@ -34,7 +34,7 @@ module GHC.List ( head, last, tail, init, uncons, (!?), (!!), scanl, scanl1, scanl', scanr, scanr1, iterate, iterate', repeat, replicate, cycle, - take, drop, splitAt, takeWhile, dropWhile, span, break, reverse, + take, drop, splitAt, takeWhile, dropWhile, span, break, break_, reverse, zip, zip3, zipWith, zipWith3, unzip, unzip3, errorEmptyList, @@ -1094,15 +1094,15 @@ span p xs@(x:xs') -- ([1,2,3],[]) -- -- 'break' @p@ is equivalent to @'span' ('not' . p)@. -break, break' :: (a -> Bool) -> [a] -> ([a],[a]) +break, break_, break' :: (a -> Bool) -> [a] -> ([a],[a]) #if defined(USE_REPORT_PRELUDE) break_ p = span (not . p) #else -- HBC version (stolen) --- break_ _ xs@[] = (xs, xs) --- break_ p xs@(x:xs') --- | p x = ([],xs) --- | otherwise = let (ys,zs) = break_ p xs' in (x:ys,zs) +break_ _ xs@[] = (xs, xs) +break_ p xs@(x:xs') + | p x = ([],xs) + | otherwise = let (ys,zs) = break_ p xs' in (x:ys,zs) #endif break' _ xs@[] = (xs, xs) |