MulLens

reactives.extra.lenses.MulLens
class MulLens[A](k: A)(using frac: Fractional[A]) extends BijectiveLens[A, A]

A simple lens for multiplication

Value parameters

k

The summand

Attributes

Graph
Supertypes
trait BijectiveLens[A, A]
trait Lens[A, A]
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def toModel(v: A): A

Override the toModel function to make the lens bijective

Override the toModel function to make the lens bijective

Attributes

def toView(m: A): A

Transforms the model to the view

Transforms the model to the view

Attributes

Inherited methods

def compose[W](other: BijectiveLens[A, W]): BijectiveLens[A, 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

Inherited from:
BijectiveLens
def compose[W](other: Lens[A, W]): Lens[A, 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
def inverse: BijectiveLens[A, A]

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

Inherited from:
BijectiveLens
override def toModel(v: A, m: A): A

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 from:
BijectiveLens