Generation of arbitrary case classes / ADTs with scalacheck and shapeless
dependabot[bot] on github_actions
Bump coursier/setup-action from… (compare)
alexarchambault on scala-cli
Switch build to Scala CLI Use Scala CLI nightly (compare)
alexarchambault on master
Update sbt to 1.6.2 (#246) * A… (compare)
alexarchambault on scala-cli
Use Scala CLI nightly (compare)
alexarchambault on sbt-main-line
Use sbt main line launcher on CI (compare)
alexarchambault on scala-cli
Switch build to Scala CLI (compare)
Arbitrary[A :+: B :+: C]
too, do you know?
MkCoproductArbitrary
IndexedStateT
from https://github.com/typelevel/cats/blob/master/core/src/main/scala/cats/data/IndexedStateT.scala to encode an input and output state of a transition.
Arbitrary
s ignore other implicits in scope? I haven’t been able to confirm or deny yet but it seems to be the case. For example:case class Foo(bar: Bar)
implicit val arbBar: Arbitrary[Bar] = somePredefinedArbitraryForBar // This is not used
implicit val arbFoo: Arbitrary[Foo] = MkArbitrary[Foo].arbitrary
could not find implicit value for parameter mkArb: org.scalacheck.derive.MkCoproductArbitrary[takt.data.valkyrie.deployables.etl.VAL1081.ValkyrieType]
ava.lang.IllegalArgumentException: requirement failed: Duration is limited to +-(2^63-1)ns (ca. 292 years)
[info] at scala.concurrent.duration.FiniteDuration.<init>(Duration.scala:583)
[info] at scala.concurrent.duration.Duration$.apply(Duration.scala:31)
[info] at scala.concurrent.duration.package$DurationLong$.durationIn$extension(package.scala:48)
[info] at scala.concurrent.duration.package$DurationLong.durationIn(package.scala:48)
import /*the automatic derivation from the library*/
implicit val arbitraryDuration: Arbitrary[Duration] = ...
implicitly[Arbitrary[SomethingThatNeedsDuration]] // this should use arbitraryDuration
Was just about to post practically the same question as above ... I have:
case class Dense[K: Field](layout: Layout, stride: Int)
but if I put an implicit val stride: Arbitrary[Int] = ...
before forAll
, in order to limit the values of stride
, it's not being picked up. It sounds like the same problem as above?
String
field apparently uses Arbitrary.arbString
and that is too generic for my application. Is there a way to customise the generators for a field using the library?