You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// There is only one overload for the `forall` that takes an explicit `Gen` parameter
// To use multiple `Gen` instances, compose them monadically before passing to `forall`
test("Multiple Gen form") {
// Compose into a single `Gen[(Int, Int)]`
valgen=for {
a <-Gen.posNum[Int]
b <-Gen.posNum[Int]
} yield (a, b)
Which is a reasonable setup IMO. Personally I'm just missing some of the handy combinators for composition. E.g. it would be nice to express that example using .product or .tupled instead of needing the multi-line for ... yield.
There's options like cats-scalacheck but it would be very convenient to be able to do this out-of-the-box.
The text was updated successfully, but these errors were encountered:
Specifically, to help with this:
weaver-test/docs/scalacheck.md
Lines 46 to 53 in 850a8a6
Which is a reasonable setup IMO. Personally I'm just missing some of the handy combinators for composition. E.g. it would be nice to express that example using
.product
or.tupled
instead of needing the multi-linefor ... yield
.There's options like cats-scalacheck but it would be very convenient to be able to do this out-of-the-box.
The text was updated successfully, but these errors were encountered: