Visitar URL original
Make IntMap split, splitLookup strict in the key by meooow25 · Pull Request #982 · haskell/containers · GitHub
Skip to content

Make IntMap split, splitLookup strict in the key - #982

Merged
treeowl merged 1 commit into
haskell:masterfrom
meooow25:intmap-split-strict
Jan 14, 2024
Merged

treeowl merged 1 commit into
haskell:masterfrom
meooow25:intmap-split-strict

Conversation

@meooow25

Copy link
Copy Markdown
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

treeowl commented Jan 13, 2024

Copy link
Copy Markdown
Contributor

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
meooow25 force-pushed the intmap-split-strict branch from caf0d7e to b540dd2 Compare January 13, 2024 23:56
@meooow25

Copy link
Copy Markdown
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

treeowl commented Jan 14, 2024

Copy link
Copy Markdown
Contributor

Awesome. Thanks!

@treeowl
treeowl merged commit 68e24da into haskell:master Jan 14, 2024
@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