diff options
Diffstat (limited to 'libraries/base/Data/OldList.hs')
-rw-r--r-- | libraries/base/Data/OldList.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libraries/base/Data/OldList.hs b/libraries/base/Data/OldList.hs index ec937e729b..bee1b6f98a 100644 --- a/libraries/base/Data/OldList.hs +++ b/libraries/base/Data/OldList.hs @@ -276,7 +276,7 @@ findIndex p = listToMaybe . findIndices p -- | The 'findIndices' function extends 'findIndex', by returning the -- indices of all elements satisfying the predicate, in ascending order. findIndices :: (a -> Bool) -> [a] -> [Int] -#ifdef USE_REPORT_PRELUDE +#if defined(USE_REPORT_PRELUDE) findIndices p xs = [ i | (x,i) <- zip xs [0..], p x] #else -- Efficient definition, adapted from Data.Sequence @@ -346,7 +346,7 @@ nub = nubBy (==) -- user-supplied equality predicate instead of the overloaded '==' -- function. nubBy :: (a -> a -> Bool) -> [a] -> [a] -#ifdef USE_REPORT_PRELUDE +#if defined(USE_REPORT_PRELUDE) nubBy eq [] = [] nubBy eq (x:xs) = x : nubBy eq (filter (\ y -> not (eq x y)) xs) #else @@ -824,7 +824,7 @@ sort :: (Ord a) => [a] -> [a] -- | The 'sortBy' function is the non-overloaded version of 'sort'. sortBy :: (a -> a -> Ordering) -> [a] -> [a] -#ifdef USE_REPORT_PRELUDE +#if defined(USE_REPORT_PRELUDE) sort = sortBy compare sortBy cmp = foldr (insertBy cmp) [] #else @@ -1083,7 +1083,7 @@ lines s = cons (case break (== '\n') s of -- | 'unlines' is an inverse operation to 'lines'. -- It joins lines, after appending a terminating newline to each. unlines :: [String] -> String -#ifdef USE_REPORT_PRELUDE +#if defined(USE_REPORT_PRELUDE) unlines = concatMap (++ "\n") #else -- HBC version (stolen) @@ -1118,7 +1118,7 @@ wordsFB c n = go -- | 'unwords' is an inverse operation to 'words'. -- It joins words with separating spaces. unwords :: [String] -> String -#ifdef USE_REPORT_PRELUDE +#if defined(USE_REPORT_PRELUDE) unwords [] = "" unwords ws = foldr1 (\w s -> w ++ ' ':s) ws #else |