AffineFold

dev.constructive.eo.optics.AffineFold$package.AffineFold
object AffineFold

Constructors for AffineFold.

Attributes

Source
AffineFold.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
AffineFold.type

Members list

Grouped members

Constructors

def apply[S, A](matches: S => Option[A]): PickFold[S, A]

Build from matches: S => Option[A].

Build from matches: S => Option[A].

Attributes

Example
case class Person(age: Int)
val adultAge = AffineFold[Person, Int](p => Option.when(p.age >= 18)(p.age))
Source
AffineFold.scala

Value members

Concrete methods

def select[A](p: A => Boolean): PickFold[A, A]

Filtering — hits only on inputs satisfying p. @group Constructors

Filtering — hits only on inputs satisfying p. @group Constructors

Attributes

Source
AffineFold.scala