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

Do a cleanup pass on Core #971

Merged
merged 7 commits into from
Aug 2, 2018
Merged

Do a cleanup pass on Core #971

merged 7 commits into from
Aug 2, 2018

Conversation

pakoito
Copy link
Member

@pakoito pakoito commented Aug 2, 2018

As @trevorsummerssmith reported, the behavior of map and flatMap for core constructs was inconsistent inside comprehensions. We'd like for both to be available, at least for the constructs in core.

This PR addresses that to have a more consistent model for inlining: only transformations and getters are inlined.

A second fix removes unnecessary object creation from the implementation of operators. For this, Try.Failure now extends Try<Nothing>

@pakoito pakoito changed the title Do a pass on inlining transformations in Core Do a cleanup pass on Core Aug 2, 2018
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.

Great stuff 👏

@codecov
Copy link

codecov bot commented Aug 2, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@630fa7e). Click here to learn what that means.
The diff coverage is 45.94%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #971   +/-   ##
=========================================
  Coverage          ?   46.66%           
  Complexity        ?      660           
=========================================
  Files             ?      308           
  Lines             ?     8002           
  Branches          ?      822           
=========================================
  Hits              ?     3734           
  Misses            ?     3939           
  Partials          ?      329
Impacted Files Coverage Δ Complexity Δ
...ore/arrow-core/src/main/kotlin/arrow/core/utils.kt 50% <ø> (ø) 0 <0> (?)
...x/src/main/kotlin/arrow/syntax/collections/list.kt 80% <ø> (ø) 0 <0> (?)
...tances-core/src/main/kotlin/arrow/instances/try.kt 65.11% <ø> (ø) 0 <0> (?)
...rc/main/kotlin/arrow/test/generators/Generators.kt 76.31% <0%> (ø) 0 <0> (?)
...s/core/arrow-core/src/main/kotlin/arrow/core/Id.kt 78.57% <100%> (ø) 6 <1> (?)
.../core/arrow-core/src/main/kotlin/arrow/core/Try.kt 64.7% <33.33%> (ø) 22 <5> (?)
...re/arrow-core/src/main/kotlin/arrow/core/Either.kt 44.44% <42.85%> (ø) 8 <2> (?)
...re/arrow-core/src/main/kotlin/arrow/core/Option.kt 62.71% <61.53%> (ø) 22 <15> (?)

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 630fa7e...1de09e8. Read the comment docs.

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.

2 participants