Closed metcalf closed 5 years ago
Merging #361 into develop will increase coverage by
0.18%
. The diff coverage is80%
.
@@ Coverage Diff @@
## develop #361 +/- ##
==========================================
+ Coverage 46.32% 46.5% +0.18%
==========================================
Files 84 84
Lines 3050 3051 +1
Branches 135 142 +7
==========================================
+ Hits 1413 1419 +6
+ Misses 1637 1632 -5
Impacted Files | Coverage Δ | |
---|---|---|
...in/scala/com/stripe/rainier/core/Categorical.scala | 22.41% <0%> (ø) |
:arrow_up: |
.../scala/com/stripe/rainier/scalacheck/package.scala | 92.85% <100%> (ø) |
:arrow_up: |
...main/scala/com/stripe/rainier/core/Generator.scala | 91.04% <84.61%> (+3.16%) |
:arrow_up: |
...ain/scala/com/stripe/rainier/compute/RealOps.scala | 79.66% <0%> (+2.54%) |
: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 5c91f4a...a2831a2. Read the comment docs.
I'd love to get @non or @andyscott's take on this.
What I'm not sure about here is whether it's actually desirable to have a generic Generator.traverse
which can handle arbitrary data structures, or whether it's better to have a small number of specific variants like traverseMap
.
I would flip this around and use existing machinery in cats:
traverse
Closing this since I'm pretty sure we don't think this is the right approach.
This re-implements
Generator.traverse
based on aGeneratorTraversal
implicit trait. This allows for defining traversals for custom classes as demonstrated in the test. I'm pretty sure you could use shapeless with this to implement traversal for any case class where each member has aToGenerator
.Assuming this looks good, I'll implement the same thing for RandomVariable.