Optic

case class Optic[-GetWhole, -SetWholeBefore, -SetPiece, +GetError, +SetError, +GetPiece, +SetWholeAfter](getOptic: GetWhole => OpticResult[(GetError, SetWholeAfter), GetPiece], setOptic: SetPiece => SetWholeBefore => OpticResult[(SetError, SetWholeAfter), SetWholeAfter])

An Optic is able to get and set a piece of a whole, possibly failing. In the most general possible case the get and set types are distinct and getting may fail with a different error than setting.

An Optic is able to get and set a piece of a whole, possibly failing. In the most general possible case the get and set types are distinct and getting may fail with a different error than setting.

Companion
object
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Value members

Concrete methods

final def <*>[GetWhole1 <: GetWhole, SetWholeBefore1 >: SetWholeAfter <: SetWholeBefore, SetPiece2, GetError1 >: GetError, SetError1 >: SetError, GetPiece2, SetWholeAfter1 >: SetWholeAfter](that: Optic[GetWhole1, SetWholeBefore1, SetPiece2, GetError1, SetError1, GetPiece2, SetWholeAfter1]): Optic[GetWhole1, SetWholeBefore1, (SetPiece, SetPiece2), GetError1, SetError1, (GetPiece, GetPiece2), SetWholeAfter1]

A symbolic alias for zip.

A symbolic alias for zip.

final def <>[GetWhole1 <: GetWhole, SetWholeBefore1 <: SetWholeBefore, SetPiece1 <: SetPiece, GetError2, SetError2, GetPiece1 >: GetPiece, SetWholeAfter1 >: SetWholeAfter](that: => Optic[GetWhole1, SetWholeBefore1, SetPiece1, GetError2, SetError2, GetPiece1, SetWholeAfter1]): Optic[GetWhole1, SetWholeBefore1, SetPiece1, GetError2, SetError2, GetPiece1, SetWholeAfter1]

A symbolic alias for orElse.

A symbolic alias for orElse.

final def apply(whole: GetWhole & SetWholeBefore): OpticPartiallyApplied[SetPiece, GetError, SetError, GetPiece, SetWholeAfter]

Applies this optic to the specified whole, returning a new optic that no longer needs a whole to get and set and always gets and sets a piece of the specified whole.

Applies this optic to the specified whole, returning a new optic that no longer needs a whole to get and set and always gets and sets a piece of the specified whole.

final def get(whole: GetWhole): OpticResult[GetError, GetPiece]

Gets a piece of the specified whole.

Gets a piece of the specified whole.

final def orElse[GetWhole1 <: GetWhole, SetWholeBefore1 <: SetWholeBefore, SetPiece1 <: SetPiece, GetError2, SetError2, GetPiece1 >: GetPiece, SetWholeAfter1 >: SetWholeAfter](that: => Optic[GetWhole1, SetWholeBefore1, SetPiece1, GetError2, SetError2, GetPiece1, SetWholeAfter1]): Optic[GetWhole1, SetWholeBefore1, SetPiece1, GetError2, SetError2, GetPiece1, SetWholeAfter1]

Constructs a new optic that attempts to get and set with this optic, but if getting or setting fails falls back to getting or setting with that optic.

Constructs a new optic that attempts to get and set with this optic, but if getting or setting fails falls back to getting or setting with that optic.

final def zip[GetWhole1 <: GetWhole, SetWholeBefore1 >: SetWholeAfter <: SetWholeBefore, SetPiece2, GetError1 >: GetError, SetError1 >: SetError, GetPiece2, SetWholeAfter1 >: SetWholeAfter](that: Optic[GetWhole1, SetWholeBefore1, SetPiece2, GetError1, SetError1, GetPiece2, SetWholeAfter1]): Optic[GetWhole1, SetWholeBefore1, (SetPiece, SetPiece2), GetError1, SetError1, (GetPiece, GetPiece2), SetWholeAfter1]

Constructs a new optic that gets and sets with both this optic and that optic. This optic and that optic must get and set different pieces of the whole.

Constructs a new optic that gets and sets with both this optic and that optic. This optic and that optic must get and set different pieces of the whole.

Inherited methods

def productElementNames: Iterator[String]
Inherited from
Product
def productIterator: Iterator[Any]
Inherited from
Product