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

Fix Foldable foldMapM restrictions #1054

Merged
merged 1 commit into from
Oct 20, 2018
Merged

Conversation

AdrianRaFo
Copy link
Contributor

@AdrianRaFo AdrianRaFo commented Oct 20, 2018

We were applying the Monad and Monoid restrictions to the same type TC.

This PR and the monoid parameter separately solving that.

@AdrianRaFo AdrianRaFo changed the title Fix foldable foldMapM restrictions Fix Foldable foldMapM restrictions Oct 20, 2018
@codecov
Copy link

codecov bot commented Oct 20, 2018

Codecov Report

Merging #1054 into master will decrease coverage by <.01%.
The diff coverage is 50%.

Impacted file tree graph

@@             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
Impacted Files Coverage Δ Complexity Δ
...sses/src/main/kotlin/arrow/typeclasses/Foldable.kt 53.65% <50%> (-1.35%) 0 <0> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 813149b...cdaf2b8. Read the comment docs.

Copy link
Member

@raulraja raulraja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @AdrianRaFo !

@raulraja raulraja merged commit 3c3a43d into master Oct 20, 2018
@raulraja raulraja deleted the arf-fix-foldable-foldMapM branch October 20, 2018 15:16
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 {
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed here #1058

@raulraja raulraja mentioned this pull request Nov 2, 2018
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 this pull request may close these issues.

3 participants