-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve foldl and foldr for IntSet #667
base: master
Are you sure you want to change the base?
Conversation
`foldrBits` was previously defined just like `foldr'Bits`, and `foldlBits` was defined just like `foldl'Bits`. That is, each of them built up an accumulator, lazily, across a whole leaf before producing anything. Swap that around so the folds can process values promptly. Fixes haskell#666
I've done a bit of benchmarking. My results aren't very stable, but it seems, generally, that |
Er.... no, that's not it. The reversing happens with |
@oisdk, this looks like the sort of thing you might know how to think about and test properly. Any ideas? |
@treeowl do you want to continue with this PR? The changes to |
I'm currently recovering from COVID, so can't really do much this week. |
Hope you get well soon! I didn't mean to imply any sort of urgency, this can surely wait. |
I feel bad for making you wait so long on multiple things. |
I have had some free time, don't worry about it 😅 |
foldrBits
was previously defined just likefoldr'Bits
, andfoldlBits
was defined just likefoldl'Bits
. That is, each of thembuilt up an accumulator, lazily, across a whole leaf before producing
anything. Swap that around so the folds can process values promptly.
Fixes #666