-
Notifications
You must be signed in to change notification settings - Fork 103
Add operator HashMap.!? #175
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
Add operator HashMap.!? #175
Conversation
This is equivalent to `lookup` with the arguments flipped. This operator was added to containers-0.5.9.1, this makes the HashMap interface consistent. This partially addresses haskell-unordered-containers#172.
|
This sounds reasonable. |
|
You have legit build failures. You'll need to fix some import/export business. |
Forgot to stage the files in the first commit.
|
I wasn't sure if it would be beneficial to add benchmarks for this or not since its equivalent to |
|
Don't bother. |
[ci skip]
|
Gotcha, this is ready for review. |
|
Resolved merge conflicts, PTAL! |
Data/HashMap/Base.hs
Outdated
| -- | ||
| -- This is a flipped version of 'lookup'. | ||
| -- | ||
| -- @since 0.2.9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We sure about that number?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of date since last update, was just waiting for the findWithDefault fix to go into master since the CI was failing on this PR too. Have updated to 0.2.11 and updated CHANGES.md appropriately as well. Most recent commit should have the updated annotation.
emilypi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. No significant comments since you've already addressed @treeowl's
emilypi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks
| {-# INLINE lookupCont #-} | ||
|
|
||
| -- | /O(log n)/ Return the value to which the specified key is mapped, | ||
| -- or 'Nothing' if this map contains no mapping for the key. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably revisit the O(log n) claim at some point, since our hashing is not too random for, e.g., Int. But that doesn't have to be handled in this PR.
This is equivalent to
lookupwith the arguments flipped. This operator wasadded to containers-0.5.9.1, this makes the
HashMapinterface consistent.This partially addresses #172.