Make Data.List.foldr1 inline
Previously, foldr1 would be defiend recursively and thus not inline. This is bad, for example, when maximumBy has a strict comparison function: Before the BBP, it was implemented via foldl1, which inlined and yielded good code. With BBP, it goes via foldr1, so we better inline this as well. Fixes #10830. Differential Revision: https://phabricator.haskell.org/D1205
Showing
- libraries/base/GHC/List.hs 5 additions, 3 deletionslibraries/base/GHC/List.hs
- testsuite/tests/simplCore/should_run/T10830.hs 3 additions, 0 deletionstestsuite/tests/simplCore/should_run/T10830.hs
- testsuite/tests/simplCore/should_run/all.T 1 addition, 0 deletionstestsuite/tests/simplCore/should_run/all.T
Please register or sign in to comment