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

Strictify maps #103

Merged
merged 2 commits into from Apr 8, 2023
Merged

Strictify maps #103

merged 2 commits into from Apr 8, 2023

Conversation

treeowl
Copy link
Collaborator

@treeowl treeowl commented Apr 3, 2023

  • Make mapping force spines.
  • Deprecate seqSpine. It shouldn't be needed any more.

Closes #100

@treeowl treeowl requested a review from konsumlamm April 3, 2023 19:54
@treeowl treeowl force-pushed the strictify-maps branch 4 times, most recently from 4805c0a to 92757de Compare April 3, 2023 21:14
@konsumlamm
Copy link
Collaborator

Are you sure those are all mapping functions that need modification? What about Data.PQueue.Prio.Internals.mapForest (although it seems that one isn't even used anywhere) and Data.PQueue.Min.keysF?

Very little can actually be done to a queue without (potentially)
forcing its whole spine. So leaving spines lazy for mapping and
traversing gains very little performance in practice and makes
performance less predictable.

Closes lspitzner#100
Now that maps and unordered traversals force the result spines,
`seqSpine` is no longer useful.
@treeowl
Copy link
Collaborator Author

treeowl commented Apr 8, 2023

Are you sure those are all mapping functions that need modification? What about Data.PQueue.Prio.Internals.mapForest (although it seems that one isn't even used anywhere) and Data.PQueue.Min.keysF?

Good catches. I just fixed those.

@treeowl treeowl merged commit b648c0f into lspitzner:master Apr 8, 2023
11 checks passed
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.

Make mapU/mapMonotonic and Prio.mapKeysMonotonic spine-strict
2 participants