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 IntMap split, splitLookup strict in the key #982

Merged
merged 1 commit into from
Jan 14, 2024

Conversation

meooow25
Copy link
Contributor

All IntMap and IntSet functions taking a key are strict in the key. This allows the Int to be unboxed.

This is technically a breaking change. Currently split undefined empty = (empty, empty), but with this change split undefined empty = undefined.

@treeowl
Copy link
Contributor

treeowl commented Jan 13, 2024

Could you add a change log entry please? What were you doing that led you to notice this?

Currently, the key is ignored for an empty map.

All IntMap and IntSet functions taking a key are strict in the key.
This allows the Int to be unboxed.
@meooow25
Copy link
Contributor Author

Could you add a change log entry please?

Done 👍

What were you doing that led you to notice this?

I have a structure that stores (Int, Int) ranges as IntMap Int, with some operations defined in terms of splitLookup. I checked the core for those operations and noticed that the Ints were boxed, which led me to this.

@treeowl
Copy link
Contributor

treeowl commented Jan 14, 2024

Awesome. Thanks!

@treeowl treeowl merged commit 68e24da into haskell:master Jan 14, 2024
8 checks passed
@meooow25 meooow25 deleted the intmap-split-strict branch January 14, 2024 00:19
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.

2 participants