scalaprops.scalazlaws.align.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scalaprops-scalazlaws_2.12.0-M4 Show documentation
Show all versions of scalaprops-scalazlaws_2.12.0-M4 Show documentation
property based testing library for Scala
The newest version!
package scalaprops
package scalazlaws
import scalaprops.Property.forAll
import scalaprops.Properties.properties
import scalaz._
object align {
def collapse[F[_], A](implicit F: Align[F], E: Equal[F[A \&/ A]], A: Gen[F[A]]) =
forAll(F.alignLaw.collapse[A] _)
def laws[F[_]](implicit F: Align[F], af: Gen[F[Int]],
e: Equal[F[Int]], ef: Equal[F[Int \&/ Int]]) = properties(ScalazLaw.align)(
ScalazLaw.alignCollapse -> collapse[F, Int]
)
def all[F[_]: Align](implicit af: Gen[F[Int]],
e: Equal[F[Int]], ef: Equal[F[Int \&/ Int]]) =
Properties.fromProps(ScalazLaw.alignAll, functor.all[F], align.laws[F])
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy