Skip to content
This repository was archived by the owner on Oct 4, 2020. It is now read-only.

delete and view min/max #129

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

matthewleon
Copy link
Contributor

Allows for log(n) deletion and plucking of min and max pairs from maps.

@matthewleon
Copy link
Contributor Author

Leaving a note here that minView and maxView aren't getting TCO'd because of this: purescript/purescript#3157

Given that the number of recursive steps is O(log(number of elements)) this is probably fine.

@natefaubion
Copy link
Contributor

natefaubion commented Dec 31, 2017

You could just use unsafeCrashWith for the ommitted case instead of unsafePartial on the expression. Since we don't propagate the Partial constraint there's not really a difference.

@matthewleon
Copy link
Contributor Author

You could just use unsafeCrashWith for the ommitted case instead of unsafePartial on the expression.

Thanks! That worked.

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

Successfully merging this pull request may close these issues.

2 participants