harness.core.Unapply.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of harness-core_sjs1_3 Show documentation
Show all versions of harness-core_sjs1_3 Show documentation
Miscellaneous libraries/utilities for Scala.
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