LensFamily

sealed abstract
class LensFamily[A1, A2, B1, B2]

A Lens Family, offering a purely functional means to access and retrieve a field transitioning from type B1 to type B2 in a record simultaneously transitioning from type A1 to type A2. scalaz.Lens is a convenient alias for when A1 === A2, and B1 === B2.

The term ''field'' should not be interpreted restrictively to mean a member of a class. For example, a lens family can address membership of a Set.

Type Params
A1

The initial type of the record

A2

The final type of the record

B1

The initial type of the field

B2

The final type of the field

See also
Companion
object
class Object
trait Matchable
class Any

Type members

Classlikes

trait LensLaw

Value members

Abstract methods

def run(a: A1): IndexedStore[B1, B2, A2]

Concrete methods

def %%=[C](s: IndexedState[B1, B2, C]): IndexedState[A1, A2, C]
def %=(f: B1 => B2): IndexedState[A1, A2, B2]

Modify the portion of the state viewed through the lens and return its new value.

Modify the portion of the state viewed through the lens and return its new value.

def %==(f: B1 => B2): IndexedState[A1, A2, Unit]

Modify the portion of the state viewed through the lens, but do not return its new value.

Modify the portion of the state viewed through the lens, but do not return its new value.

def &=(that: Set[K]): IndexedState[S1, S2, Set[K]]
Implicitly added by setLensFamily
def &~=(that: Set[K]): IndexedState[S1, S2, Set[K]]
Implicitly added by setLensFamily
def ***[C1, C2, D1, D2](that: LensFamily[C1, C2, D1, D2]): LensFamily[(A1, C1), (A2, C2), (B1, D1), (B2, D2)]

alias for product

alias for product

def ++=(xs: IterableOnce[(K, V)]): IndexedState[S1, S2, Map[K, V]]
Implicitly added by mapLensFamily
def ++=(xs: IterableOnce[K]): IndexedState[S1, S2, Set[K]]
Implicitly added by setLensFamily
def +=(elem1: (K, V), elem2: (K, V), elems: (K, V)*): IndexedState[S1, S2, Map[K, V]]
Implicitly added by mapLensFamily
def +=(elem: (K, V)): IndexedState[S1, S2, Map[K, V]]
Implicitly added by mapLensFamily
def +=(elem: K): IndexedState[S1, S2, Set[K]]
Implicitly added by setLensFamily
def +=(elem1: K, elem2: K, elems: K*): IndexedState[S1, S2, Set[K]]
Implicitly added by setLensFamily
def --=(xs: IterableOnce[K]): IndexedState[S1, S2, Map[K, V]]
Implicitly added by mapLensFamily
def --=(xs: IterableOnce[K]): IndexedState[S1, S2, Set[K]]
Implicitly added by setLensFamily
def -=(elem: K): IndexedState[S1, S2, Map[K, V]]
Implicitly added by mapLensFamily
def -=(elem1: K, elem2: K, elems: K*): IndexedState[S1, S2, Map[K, V]]
Implicitly added by mapLensFamily
def -=(elem: K): IndexedState[S1, S2, Set[K]]
Implicitly added by setLensFamily
def -=(elem1: K, elem2: K, elems: K*): IndexedState[S1, S2, Set[K]]
Implicitly added by setLensFamily
def ->>-[C](f: => IndexedState[A1, A2, C]): IndexedState[A1, A2, C]

Sequence the monadic action of looking through the lens to occur before the state action f.

Sequence the monadic action of looking through the lens to occur before the state action f.

def :=(b: => B2): IndexedState[A1, A2, B2]

Set the portion of the state viewed through the lens and return its new value.

Set the portion of the state viewed through the lens and return its new value.

def <%=(f: B1 => B2): IndexedState[A1, A2, B1]

Modify the portion of the state viewed through the lens and return its old value. alias for modo

Modify the portion of the state viewed through the lens and return its old value. alias for modo

Since

7.0.2

def <:=(b: => B2): IndexedState[A1, A2, B1]

Set the portion of the state viewed through the lens and return its old value. alias for assigno

Set the portion of the state viewed through the lens and return its old value. alias for assigno

Since

7.0.2

def <=<[C1, C2](that: LensFamily[C1, C2, A1, A2]): LensFamily[C1, C2, B1, B2]

alias for compose

alias for compose

def =>=(f: B1 => B2): A1 => A2
def =>>=[X[_]](f: B1 => X[B2])(implicit XF: Functor[X]): A1 => X[A2]
def >-[C](f: B1 => C): State[A1, C]

Map the function f over the value under the lens, as a state action.

Map the function f over the value under the lens, as a state action.

def >=>[C1, C2](that: LensFamily[B1, B2, C1, C2]): LensFamily[A1, A2, C1, C2]

alias for andThen

alias for andThen

def >>-[C](f: B1 => IndexedState[A1, A2, C]): IndexedState[A1, A2, C]

Bind the function f over the value under the lens, as a state action.

Bind the function f over the value under the lens, as a state action.

def andThen[C1, C2](that: LensFamily[B1, B2, C1, C2]): LensFamily[A1, A2, C1, C2]
def apply(a: A1): IndexedStore[B1, B2, A2]
def assign(b: => B2): IndexedState[A1, A2, B2]

Set the portion of the state viewed through the lens and return its new value.

Set the portion of the state viewed through the lens and return its new value.

def assigno(b: => B2): IndexedState[A1, A2, B1]

Set the portion of the state viewed through the lens and return its old value.

Set the portion of the state viewed through the lens and return its old value.

Since

7.0.2

def at(n: Int): LensFamily[S1, S2, A, A]
Implicitly added by arrayLensFamily
def at(k: K): LensFamily[S1, S2, V, V]
Implicitly added by mapLensFamily

This lens has undefined behavior when accessing an element not present in the map!

This lens has undefined behavior when accessing an element not present in the map!

def compose[C1, C2](that: LensFamily[C1, C2, A1, A2]): LensFamily[C1, C2, B1, B2]

Lenses can be composed

Lenses can be composed

def contains(key: K): LensFamily[S1, S2, Boolean, Boolean]
Implicitly added by setLensFamily

Setting the value of this lens will change whether or not it is present in the set

Setting the value of this lens will change whether or not it is present in the set

def dequeue: IndexedState[S1, S2, A]
Implicitly added by queueLensFamily
def enqueue(elem: A): IndexedState[S1, S2, Unit]
Implicitly added by queueLensFamily
def flatMap[C](f: B1 => IndexedState[A1, A2, C]): IndexedState[A1, A2, C]

Bind the function f over the value under the lens, as a state action.

Bind the function f over the value under the lens, as a state action.

def get(a: A1): B1
def length: State[S1, Int]
Implicitly added by arrayLensFamily
def length: State[S1, Int]
Implicitly added by queueLensFamily
def lifts[C](s: IndexedState[B1, B2, C]): IndexedState[A1, A2, C]

Contravariantly map a state action through a lens.

Contravariantly map a state action through a lens.

def liftsNT: NaturalTransformation[[_] =>> IndexedState[B1, B2, _$14], [_] =>> IndexedState[A1, A2, _$15]]

Contravariantly mapping the state of a state monad through a lens is a natural transformation

Contravariantly mapping the state of a state monad through a lens is a natural transformation

def map[C](f: B1 => C): State[A1, C]

Map the function f over the lens as a state action.

Map the function f over the lens as a state action.

def member(k: K): LensFamily[S1, S2, Option[V], Option[V]]
Implicitly added by mapLensFamily

Allows both viewing and setting the value of a member of the map

Allows both viewing and setting the value of a member of the map

def mod(f: B1 => B2, a: A1): A2

Modify the value viewed through the lens

Modify the value viewed through the lens

def modf[X[_]](f: B1 => X[B2], a: A1)(implicit XF: Functor[X]): X[A2]

Modify the value viewed through the lens, returning a functor X full of results.

Modify the value viewed through the lens, returning a functor X full of results.

def modo(f: B1 => B2): IndexedState[A1, A2, B1]

Modify the portion of the state viewed through the lens and return its old value.

Modify the portion of the state viewed through the lens and return its old value.

Since

7.0.2

def modp[C](f: B1 => (B2, C), a: A1): (A2, C)

Modify the value viewed through the lens, returning a C on the side.

Modify the value viewed through the lens, returning a C on the side.

def mods(f: B1 => B2): IndexedState[A1, A2, B2]

Modify the portion of the state viewed through the lens and return its new value.

Modify the portion of the state viewed through the lens and return its new value.

def mods_(f: B1 => B2): IndexedState[A1, A2, Unit]

Modify the portion of the state viewed through the lens, but do not return its new value.

Modify the portion of the state viewed through the lens, but do not return its new value.

def partial: PLensFamily[A1, A2, B1, B2]

A homomorphism of lens categories

A homomorphism of lens categories

def product[C1, C2, D1, D2](that: LensFamily[C1, C2, D1, D2]): LensFamily[(A1, C1), (A2, C2), (B1, D1), (B2, D2)]

Two disjoint lenses can be paired

Two disjoint lenses can be paired

def set(a: A1, b: B2): A2
def setf[X[_]](a: A1, b: X[B2])(implicit XF: Functor[X]): X[A2]
def sort[B >: A](implicit ord: Ordering[B]): IndexedState[S1, S2, Unit]
Implicitly added by seqLensFamily
def sort[B >: A](implicit ord: Ordering[B]): IndexedState[S1, S2, Unit]
Implicitly added by seqLikeLensFamily
def sortBy[B : Ordering](f: A => B): IndexedState[S1, S2, Unit]
Implicitly added by seqLensFamily
def sortBy[B : Ordering](f: A => B): IndexedState[S1, S2, Unit]
Implicitly added by seqLikeLensFamily
def sortWith(lt: (A, A) => Boolean): IndexedState[S1, S2, Unit]
Implicitly added by seqLensFamily
def sortWith(lt: (A, A) => Boolean): IndexedState[S1, S2, Unit]
Implicitly added by seqLikeLensFamily
def st: State[A1, B1]
def sum[C1, C2](that: => LensFamily[C1, C2, B1, B2]): LensFamily[A1 \/ C1, A2 \/ C2, B1, B2]

Two lenses that view a value of the same type can be joined

Two lenses that view a value of the same type can be joined

def unary_~: PLensFamily[A1, A2, B1, B2]

alias for partial

alias for partial

def update(key: K, value: V): IndexedState[S1, S2, Unit]
Implicitly added by mapLensFamily
def xmapA[X1, X2](f: A2 => X2)(g: X1 => A1): LensFamily[X1, X2, B1, B2]
def xmapB[X1, X2](f: B1 => X1)(g: X2 => B2): LensFamily[A1, A2, X1, X2]
def xmapbA[X, A >: A2 <: A1](b: Bijection[A, X]): LensFamily[X, X, B1, B2]
def xmapbB[X, B >: B1 <: B2](b: Bijection[B, X]): LensFamily[A1, A2, X, X]
def |=(that: Set[K]): IndexedState[S1, S2, Set[K]]
Implicitly added by setLensFamily
def |||[C1, C2](that: => LensFamily[C1, C2, B1, B2]): LensFamily[A1 \/ C1, A2 \/ C2, B1, B2]

Alias for sum

Alias for sum

Inherited methods

def productElementNames: Iterator[String]
Implicitly added by arrayLensFamily
Inherited from
Product
def productElementNames: Iterator[String]
Implicitly added by mapLensFamily
Inherited from
Product
def productElementNames: Iterator[String]
Implicitly added by queueLensFamily
Inherited from
Product
def productElementNames: Iterator[String]
Implicitly added by seqLensFamily
Inherited from
Product
def productElementNames: Iterator[String]
Implicitly added by seqLikeLensFamily
Inherited from
Product
def productElementNames: Iterator[String]
Implicitly added by setLensFamily
Inherited from
Product
def productIterator: Iterator[Any]
Implicitly added by arrayLensFamily
Inherited from
Product
def productIterator: Iterator[Any]
Implicitly added by mapLensFamily
Inherited from
Product
def productIterator: Iterator[Any]
Implicitly added by queueLensFamily
Inherited from
Product
def productIterator: Iterator[Any]
Implicitly added by seqLensFamily
Inherited from
Product
def productIterator: Iterator[Any]
Implicitly added by seqLikeLensFamily
Inherited from
Product
def productIterator: Iterator[Any]
Implicitly added by setLensFamily
Inherited from
Product