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

CommutativeSemigroup[A] => CommutativeMonoid[Option[A]] #2725

Closed
ceedubs opened this issue Feb 4, 2019 · 4 comments
Closed

CommutativeSemigroup[A] => CommutativeMonoid[Option[A]] #2725

ceedubs opened this issue Feb 4, 2019 · 4 comments

Comments

@ceedubs
Copy link
Contributor

ceedubs commented Feb 4, 2019

It looks like having a CommutativeSemigroup[A] currently doesn't get you CommutativeMonoid[Option[A]]. I think that's something that we should be able to provide. Does anyone have a reason not to include this instance?

@ctongfei
Copy link
Contributor

ctongfei commented Feb 8, 2019

Can we get a Monoid[Option[A]] from a Semigroup[A] in cats now?

@LukaJCB
Copy link
Member

LukaJCB commented Feb 8, 2019

@ctongfei
Copy link
Contributor

ctongfei commented Feb 8, 2019

@LukaJCB Ahh thanks!

@kailuowang
Copy link
Contributor

kailuowang commented Feb 8, 2019

to fix this we need to move the current Monoid instance to OptionInstances0, so that we can add the commutative one on top.
This change will be binary breaking on scala 2.11 though. There might be convoluted ways to do it in scala2.11 but it's not obvious to me. If it's not urgent, shall we schedule it to 2.1?

valydia pushed a commit to valydia/cats that referenced this issue May 8, 2019
valydia pushed a commit to valydia/cats that referenced this issue May 8, 2019
valydia pushed a commit to valydia/cats that referenced this issue May 8, 2019
valydia pushed a commit to valydia/cats that referenced this issue May 28, 2019
kailuowang pushed a commit that referenced this issue Nov 6, 2019
* Add FreeT.inject helper function (#1534)

* Rename FreeT.inject to FreeT.liftInject (#1534)

* Add Free.liftInject helper function (#1534)

* Add CommutativeMonoid[Option[A]] instance (#2725)

* Update laws

* Format the codebase

* Remove unnecessary change

* Make instance helper class private
@LukaJCB LukaJCB closed this as completed Dec 21, 2019
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

4 participants