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

Add Ior#mergeWith and Align#alignMergeWith #3804

Closed
nigredo-tori opened this issue Feb 18, 2021 · 0 comments · Fixed by #3805
Closed

Add Ior#mergeWith and Align#alignMergeWith #3804

nigredo-tori opened this issue Feb 18, 2021 · 0 comments · Fixed by #3805

Comments

@nigredo-tori
Copy link
Contributor

These are versions of Ior#merge and Align#alignCombine that use explicit functions rather than Semigroup instances.

Motivation: alignMergeWith is useful in cases where the logic in case of a "conflict" doesn't match the default Semigroup instance. It is also useful in places where relying on a specific Semigroup makes the code brittle. For example, when combining nested Maps and NonEmptyMaps, changing NonEmptyMap to Map might introduce subtle errors due to different Semigroup semantics - see #3377.

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 a pull request may close this issue.

1 participant