Closed sritchie closed 5 years ago
Merging #377 into develop will increase coverage by
0.03%
. The diff coverage is0%
.
@@ Coverage Diff @@
## develop #377 +/- ##
===========================================
+ Coverage 45.84% 45.87% +0.03%
===========================================
Files 86 86
Lines 3067 3069 +2
Branches 141 135 -6
===========================================
+ Hits 1406 1408 +2
Misses 1661 1661
Impacted Files | Coverage Δ | |
---|---|---|
...main/scala/com/stripe/rainier/compute/ToReal.scala | 73.33% <0%> (-11.29%) |
:arrow_down: |
...ain/scala/com/stripe/rainier/compute/RealOps.scala | 78.81% <0%> (+1.69%) |
:arrow_up: |
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 967bc86...2795b2e. Read the comment docs.
LGTM
This PR adds a
contramap
implementation; this lets me get instances ofToReal[B]
for types where I can extract something numeric, say, but for which I can't actually define aNumeric[B]
instance.I'm using this with algebird's
AveragedValue
. I'd like to be able to have theToReal
implicit handle the conversion rather than explicitly taking a function fromT => Double
, in this case. With this PR I can write: