-
Notifications
You must be signed in to change notification settings - Fork 443
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
Fix Foldable foldMapM restrictions #1054
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1054 +/- ##
============================================
- Coverage 39.97% 39.96% -0.01%
Complexity 711 711
============================================
Files 356 356
Lines 9977 9978 +1
Branches 1046 1046
============================================
Hits 3988 3988
- Misses 5690 5691 +1
Partials 299 299
Continue to review full report at Codecov.
|
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.
thanks @AdrianRaFo !
where TC : Monad<G>, TC : Monoid<B> = tc.run { | ||
foldM(tc, tc.empty()) { b, a -> f(a).map { b.combine(it) } } | ||
fun <G, A, B, MA, MO> Kind<F, A>.foldMapM(ma: MA, mo: MO, f: (A) -> Kind<G, B>): Kind<G, B> | ||
where MA : Monad<G>, MO : Monoid<B> = ma.run { |
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.
This will crash Android builds with the new compiler. You cannot nest two run
directly.
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.
Fixed here #1058
We were applying the Monad and Monoid restrictions to the same type
TC
.This PR and the monoid parameter separately solving that.