Commit 79dfb968 authored by Joachim Breitner's avatar Joachim Breitner Committed by Joachim Breitner

Inline maximum/minium a bit more aggresively

in order to allow fusion of the foldr in the foldl in the foldl' therein.
parent 78221667
...@@ -519,7 +519,7 @@ insertBy cmp x ys@(y:ys') ...@@ -519,7 +519,7 @@ insertBy cmp x ys@(y:ys')
-- It is a special case of 'Data.List.maximumBy', which allows the -- It is a special case of 'Data.List.maximumBy', which allows the
-- programmer to supply their own comparison function. -- programmer to supply their own comparison function.
maximum :: (Ord a) => [a] -> a maximum :: (Ord a) => [a] -> a
{-# NOINLINE [1] maximum #-} {-# INLINE [1] maximum #-}
maximum [] = errorEmptyList "maximum" maximum [] = errorEmptyList "maximum"
maximum xs = foldl1 max xs maximum xs = foldl1 max xs
...@@ -540,7 +540,7 @@ strictMaximum xs = foldl1' max xs ...@@ -540,7 +540,7 @@ strictMaximum xs = foldl1' max xs
-- It is a special case of 'Data.List.minimumBy', which allows the -- It is a special case of 'Data.List.minimumBy', which allows the
-- programmer to supply their own comparison function. -- programmer to supply their own comparison function.
minimum :: (Ord a) => [a] -> a minimum :: (Ord a) => [a] -> a
{-# NOINLINE [1] minimum #-} {-# INLINE [1] minimum #-}
minimum [] = errorEmptyList "minimum" minimum [] = errorEmptyList "minimum"
minimum xs = foldl1 min xs minimum xs = foldl1 min xs
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment