
eu.timepit.refined.scalacheck.package.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of refined-scalacheck_sjs0.6_2.12.0-M4 Show documentation
Show all versions of refined-scalacheck_sjs0.6_2.12.0-M4 Show documentation
Simple refinement types for Scala
The newest version!
package eu.timepit.refined
import eu.timepit.refined.api.{ RefType, Validate }
import org.scalacheck.{ Arbitrary, Gen, Prop }
package object scalacheck {
def arbitraryRefType[F[_, _], T, P](gen: Gen[T])(implicit rt: RefType[F]): Arbitrary[F[T, P]] =
Arbitrary(gen.map(rt.unsafeWrap))
def checkArbitraryRefType[F[_, _], T, P](implicit arb: Arbitrary[F[T, P]], rt: RefType[F], v: Validate[T, P]): Prop =
Prop.forAll((tp: F[T, P]) => v.isValid(rt.unwrap(tp)))
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy