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

Implement separate set union and set intersection monoids (and semigroups) #363

Open
MarekDudek opened this issue Oct 2, 2018 · 3 comments

Comments

@MarekDudek
Copy link

Currently monoid for set is union monoid, we could use both.

@jbgi
Copy link
Member

jbgi commented Oct 2, 2018

👍 for the intersection Semigroup.

For the intersection Monoid<Set<A>>, the zero would need to be the set of all values for that type , which would requires instance of Enumerator<A> (we have) and Bounded<A> (we don't have yet).

So this can be separated into two PRs if more manageable.

@toxyduck
Copy link
Contributor

Hello, I would like to contribute. Can you explain, Why do I need to use Bounded<A> for intersection monoid zero, if Enumerator<A> can provide max and min elements?

@jbgi
Copy link
Member

jbgi commented Oct 19, 2019

max and min in Enumerator only return Option values and thus this is not very practical to instanciate the intersection Monoid. We could pass min and max explicitly though and not create Bounded for now.

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

No branches or pull requests

3 participants