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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Semigroup, Semiring and Monoid docs #2323
Conversation
Make Semigroup's maybeCombine to use nullables instead of Option
Not sure exactly what's the problem:
It works for numbers tho, and list is available in master, any thoughts? |
@@ -11,7 +9,8 @@ interface Semigroup<A> { | |||
operator fun A.plus(b: A): A = | |||
this.combine(b) | |||
|
|||
fun A.maybeCombine(b: A?): A = Option.fromNullable(b).fold({ this }, { combine(it) }) | |||
fun A.maybeCombine(b: A?): A = | |||
b?.let { combine(it) } ?: this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
馃憣
@aballano , some clues 馃檶 Look at the content of the
There isn't Maybe the reason is the implementation of
It calls However, the implementation for |
It was only missing removing some of the imports that are not needed anymore.. because some extensions are now part of the companion object itself.. this should fix it: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
馃檶
* Move list extensions into companion object * Remove some imports not needed anymore * Minor change * Remove some more imports
馃憦 |
Make Semigroup's maybeCombine to use nullables instead of Option
From #2313 to the right branch 馃槄 cc @rachelcarmena