Skip to content

Conversation

@m-renaud
Copy link
Collaborator

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 #172.

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.
@treeowl
Copy link
Collaborator

treeowl commented Jan 23, 2018

This sounds reasonable.

@treeowl
Copy link
Collaborator

treeowl commented Jan 23, 2018

You have legit build failures. You'll need to fix some import/export business.

Forgot to stage the files in the first commit.
@m-renaud
Copy link
Collaborator Author

I wasn't sure if it would be beneficial to add benchmarks for this or not since its equivalent to lookup which already has benchmarks. WDYT?

@treeowl
Copy link
Collaborator

treeowl commented Jan 23, 2018

Don't bother.

@m-renaud
Copy link
Collaborator Author

Gotcha, this is ready for review.

@m-renaud
Copy link
Collaborator Author

m-renaud commented Jan 4, 2019

Resolved merge conflicts, PTAL!

--
-- This is a flipped version of 'lookup'.
--
-- @since 0.2.9
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

Copy link
Member

@emilypi emilypi left a 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

@m-renaud m-renaud requested a review from emilypi May 30, 2020 17:26
Copy link
Member

@emilypi emilypi left a 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.
Copy link
Collaborator

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.

@treeowl treeowl merged commit ed4e3f5 into haskell-unordered-containers:master May 30, 2020
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.

3 participants