
scalaprops.internal.Endo.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scalaprops-core_native0.5_3 Show documentation
Show all versions of scalaprops-core_native0.5_3 Show documentation
property based testing library for Scala
The newest version!
package scalaprops
package internal
final case class Endo[A](run: A => A) {
def apply(a: A): A = run(a)
def compose(other: Endo[A]): Endo[A] = Endo(run compose other.run)
def andThen(other: Endo[A]): Endo[A] = other compose this
}
object Endo {
private[this] val id: Endo[Any] = Endo[Any](a => a)
def idEndo[A]: Endo[A] = id.asInstanceOf[Endo[A]]
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy