summaryrefslogtreecommitdiff
path: root/libraries/base/Data/List.hs
diff options
context:
space:
mode:
authorPaolo Capriotti <p.capriotti@gmail.com>2012-07-25 13:53:19 +0100
committerPaolo Capriotti <p.capriotti@gmail.com>2012-07-25 13:53:19 +0100
commitde7d4e9d3b75e226ea60b2074947b89da358c475 (patch)
tree754db4092dbaf31681dcfaab034358b1572a2e32 /libraries/base/Data/List.hs
parentac50935b52ea9dd76f30af7ee6d4e0e76a3cc717 (diff)
downloadhaskell-de7d4e9d3b75e226ea60b2074947b89da358c475.tar.gz
Fix inline rule shadowing warnings
Diffstat (limited to 'libraries/base/Data/List.hs')
-rw-r--r--libraries/base/Data/List.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/libraries/base/Data/List.hs b/libraries/base/Data/List.hs
index 7b06daeb10..c3d1a842a1 100644
--- a/libraries/base/Data/List.hs
+++ b/libraries/base/Data/List.hs
@@ -532,6 +532,7 @@ insertBy cmp x ys@(y:ys')
-- It is a special case of 'Data.List.maximumBy', which allows the
-- programmer to supply their own comparison function.
maximum :: (Ord a) => [a] -> a
+{-# NOINLINE [1] maximum #-}
maximum [] = errorEmptyList "maximum"
maximum xs = foldl1 max xs
@@ -552,6 +553,7 @@ strictMaximum xs = foldl1' max xs
-- It is a special case of 'Data.List.minimumBy', which allows the
-- programmer to supply their own comparison function.
minimum :: (Ord a) => [a] -> a
+{-# NOINLINE [1] minimum #-}
minimum [] = errorEmptyList "minimum"
minimum xs = foldl1 min xs
@@ -592,6 +594,7 @@ minimumBy cmp xs = foldl1 minBy xs
-- particular, instead of returning an 'Int', it returns any type which is
-- an instance of 'Num'. It is, however, less efficient than 'length'.
genericLength :: (Num i) => [b] -> i
+{-# NOINLINE [1] genericLength #-}
genericLength [] = 0
genericLength (_:l) = 1 + genericLength l