summaryrefslogtreecommitdiff
path: root/compiler/utils/FastFunctions.lhs
diff options
context:
space:
mode:
authorDavid Feuer <David.Feuer@gmail.com>2014-11-13 09:10:57 +0100
committerHerbert Valerio Riedel <hvr@gnu.org>2014-11-13 09:16:49 +0100
commit212a350547e950cc5be465a3d76e346ef14bf2ab (patch)
tree61453d586c8ed748522fa4c62b51a0fbcf01ba6a /compiler/utils/FastFunctions.lhs
parentc016e6f74e26708586352fec657798f271b0675b (diff)
downloadhaskell-212a350547e950cc5be465a3d76e346ef14bf2ab.tar.gz
Improve `Foldable` instance for `Array`
Previously, `Array`s were simply converted to lists, and the list methods used. That works acceptably well for `foldr` and `foldr1`, but not so sensibly for most other things. Left folds ended up "twisted" the way they are for lists, leading to surprising performance characteristics. Moreover, this implements `length` and `null` so they check the array size directly. Finally, a test is added to the testsuite ensuring the overridden `Foldable` methods agree with their expected default semantics. Addresses #9763 Reviewed By: hvr, austin Differential Revision: https://phabricator.haskell.org/D459
Diffstat (limited to 'compiler/utils/FastFunctions.lhs')
0 files changed, 0 insertions, 0 deletions