Skip to content

unionWith of different value types #242

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

Closed
BebeSparkelSparkel opened this issue Dec 5, 2019 · 3 comments
Closed

unionWith of different value types #242

BebeSparkelSparkel opened this issue Dec 5, 2019 · 3 comments

Comments

@BebeSparkelSparkel
Copy link

unionWith seems like it would be more useful and could be used in folds if it had the type

unionWith :: (Eq k, Hashable k) => (a -> b -> c) -> HashMap k a -> HashMap k b -> HashMap k c

Would you consider changing the type or adding it as unionWith'?

@treeowl
Copy link
Collaborator

treeowl commented Dec 5, 2019

That type doesn't work. You'd need two more function arguments: a -> c and b -> c. I'd rather add a containers-like merge mechanism.

@BebeSparkelSparkel
Copy link
Author

@sjakobi
Copy link
Member

sjakobi commented May 31, 2020

Since there seems to be a consensus that a containers-style merge function as requested in #226 would be the better addition, I'll tentatively close this as a duplicate. Please reopen, if you disagree.

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

No branches or pull requests

3 participants