All Downloads are FREE. Search and download functionalities are using the official Maven repository.

harness.core.Unapply.scala Maven / Gradle / Ivy

The newest version!
package harness.core

trait Unapply[A, B] {
  def unapply(a: A): Option[B]
}
object Unapply {
  def apply[A, B](f: A => Option[B]): Unapply[A, B] = f(_)
  def fromPartialFunction[A, B](pf: PartialFunction[A, B]): Unapply[A, B] = a => pf.lift(a)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy