BijectiveLens

reactives.extra.lenses.BijectiveLens
trait BijectiveLens[M, V] extends Lens[M, V]

The base trait for all bijective lenses

Type parameters

M

The type of the model

V

The type of the view

Attributes

Graph
Supertypes
trait Lens[M, V]
class Object
trait Matchable
class Any
Known subtypes
class AddLens[A]
class MulLens[A]
class NeutralLens[A]

Members list

Value members

Abstract methods

def toModel(v: V): M

Override the toModel function to make the lens bijective

Override the toModel function to make the lens bijective

Attributes

Concrete methods

def compose[W](other: BijectiveLens[V, W]): BijectiveLens[M, W]

Overloads the compose function to return a bijective lens This version does not use an LVar internally, making it more efficient than the implementation in Lens

Overloads the compose function to return a bijective lens This version does not use an LVar internally, making it more efficient than the implementation in Lens

Value parameters

other

The other lens

Attributes

def inverse: BijectiveLens[V, M]

Inverts the lens such that e.g. an AddLens functions like a SubLens. Note that this does not change the model-view relationship, i.e. the asymmetry is not inverted.

Inverts the lens such that e.g. an AddLens functions like a SubLens. Note that this does not change the model-view relationship, i.e. the asymmetry is not inverted.

Attributes

override def toModel(v: V, m: M): M

Transforms the view to the model using the old model state

Transforms the view to the model using the old model state

Attributes

Definition Classes

Inherited methods

def compose[W](other: Lens[V, W]): Lens[M, W]

Concatenates this lens with another lens and returns the resulting lens. Internally, a LensVar is created, meaning that this function is just for convenience and not performance

Concatenates this lens with another lens and returns the resulting lens. Internally, a LensVar is created, meaning that this function is just for convenience and not performance

Value parameters

other

The other lens

Attributes

Inherited from:
Lens

Inherited and Abstract methods

def toView(m: M): V

Transforms the model to the view

Transforms the model to the view

Attributes

Inherited from:
Lens