Skip to content
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

Make Seq foldl', foldr' strict in the initial value #1077

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

meooow25
Copy link
Contributor

This matches the behavior of strict folds on sets and maps.

Closes #1072.

This matches the behavior of strict folds on sets and maps.
@treeowl treeowl merged commit 89b39f6 into haskell:master Dec 5, 2024
12 checks passed
@treeowl
Copy link
Contributor

treeowl commented Dec 5, 2024

I just merged this myself to clear it out of the way so I can play with GADTy folds. However, we need a changelog entry!

@meooow25 meooow25 deleted the seq-strict-fold branch December 9, 2024 14:36
@meooow25
Copy link
Contributor Author

meooow25 commented Dec 9, 2024

Yep!

Looking at it again, some of those $! are unnecessary now, but they shouldn't hurt. I'll check once with the benchmarks.

Edit: Removing them made no difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

foldl' and foldr' for Seq are not strict in the starting value
2 participants