diff options
author | Hécate <hecate+gitlab@glitchbra.in> | 2020-12-23 17:11:52 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-01-02 07:35:54 -0500 |
commit | 4c178374983dddb75341352aef1d15658a82463b (patch) | |
tree | 8a11dea15bbd94336536c8f4d7a933796856e8d4 /libraries/base | |
parent | bc383cb060adc97cb38e41acfb42d63a449f4b64 (diff) | |
download | haskell-4c178374983dddb75341352aef1d15658a82463b.tar.gz |
Upstream the strictness optimisation for GHC.List.{maximum,minimum}
Diffstat (limited to 'libraries/base')
-rw-r--r-- | libraries/base/GHC/List.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libraries/base/GHC/List.hs b/libraries/base/GHC/List.hs index 4146b68319..cd7ffc6637 100644 --- a/libraries/base/GHC/List.hs +++ b/libraries/base/GHC/List.hs @@ -614,7 +614,7 @@ scanr1 f (x:xs) = f x q : qs maximum :: (Ord a) => [a] -> a {-# INLINABLE maximum #-} maximum [] = errorEmptyList "maximum" -maximum xs = foldl1 max xs +maximum xs = foldl1' max xs -- We want this to be specialized so that with a strict max function, GHC -- produces good code. Note that to see if this is happending, one has to @@ -638,7 +638,7 @@ maximum xs = foldl1 max xs minimum :: (Ord a) => [a] -> a {-# INLINABLE minimum #-} minimum [] = errorEmptyList "minimum" -minimum xs = foldl1 min xs +minimum xs = foldl1' min xs {-# SPECIALIZE minimum :: [Int] -> Int #-} {-# SPECIALIZE minimum :: [Integer] -> Integer #-} |