trait PIso[S, T, A, B] extends PLens[S, T, A, B] with PPrism[S, T, A, B]
Iso is a type alias for PIso where S
= A
and T
= B
:
type Iso[S, A] = PIso[S, S, A, A]
An Iso defines an isomorphism between a type S and A:
get --------------------> S A <-------------------- reverseGet
A PIso allows to lift a function f: A => B
to S => T
and a function g: T => S
to B => A
g S T S <-------- T | ↑ | ↑ | | | | get | | reverseGet reverse.reverseGet | | reverse.get | | | | ↓ f | ↓ | A --------> B A B
A PIso is also a valid Getter, Fold, PLens, PPrism, POptional, PTraversal and PSetter
- S
the source of a PIso
- T
the modified source of a PIso
- A
the target of a PIso
- B
the modified target of a PIso
- Alphabetic
- By Inheritance
- PIso
- PPrism
- PLens
- Getter
- POptional
- PTraversal
- Fold
- PSetter
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def all(p: (A) => Boolean): (S) => Boolean
check if there is no target or the target satisfies the predicate
- def andThen[C, D](other: PIso[A, B, C, D]): PIso[S, T, C, D]
- def andThen[C, D](other: PPrism[A, B, C, D]): PPrism[S, T, C, D]
- def andThen[C, D](other: PLens[A, B, C, D]): PLens[S, T, C, D]
- def andThen[B](other: Getter[A, B]): Getter[S, B]
- def andThen[C, D](other: POptional[A, B, C, D]): POptional[S, T, C, D]
- def andThen[C, D](other: PTraversal[A, B, C, D]): PTraversal[S, T, C, D]
compose a PTraversal with another PTraversal
compose a PTraversal with another PTraversal
- Definition Classes
- PTraversal
- def andThen[B](other: Fold[A, B]): Fold[S, B]
- def andThen[C, D](other: PSetter[A, B, C, D]): PSetter[S, T, C, D]
- def apply[C, D, E, F, G, H](c: C, d: D, e: E, f: F, g: G, h: H)(implicit ev: <~<[(C, D, E, F, G, H), B]): T
- def apply[C, D, E, F, G](c: C, d: D, e: E, f: F, g: G)(implicit ev: <~<[(C, D, E, F, G), B]): T
- def apply[C, D, E, F](c: C, d: D, e: E, f: F)(implicit ev: <~<[(C, D, E, F), B]): T
- def apply[C, D, E](c: C, d: D, e: E)(implicit ev: <~<[(C, D, E), B]): T
- def apply[C, D](c: C, d: D)(implicit ev: <~<[(C, D), B]): T
- def apply(b: B): T
- def apply()(implicit ev: Is[B, Unit]): T
**********************************************************************
- def asFold: Fold[S, A]
- def asGetter: Getter[S, A]
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def asLens: PLens[S, T, A, B]
- def asOptional: POptional[S, T, A, B]
- def asPrism: PPrism[S, T, A, B]
- def asSetter: PSetter[S, T, A, B]
- Definition Classes
- PIso → PTraversal
- def asTraversal: PTraversal[S, T, A, B]
view a PIso as a PTraversal
view a PIso as a PTraversal
- def choice[S1](other: Getter[S1, A]): Getter[Either[S, S1], A]
join two Getter with the same target
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def exist(p: (A) => Boolean): (S) => Boolean
check if the target satisfies the predicate
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def find(p: (A) => Boolean): (S) => Option[A]
find if the target satisfies the predicate
- def fold(s: S)(implicit ev: Monoid[A]): A
combine all targets using a target's Monoid
combine all targets using a target's Monoid
- Definition Classes
- Fold
- def foldMap[M](f: (A) => M)(s: S)(implicit arg0: Monoid[M]): M
map each target to a Monoid and combine the results underlying representation of Fold, all Fold methods are defined in terms of foldMap
- def getAll(s: S): List[A]
get all the targets of a Fold
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getOption(s: S): Option[A]
get the target of a POptional or nothing if there is no target
- def getOrModify(s: S): Either[T, A]
get the target of a POptional or return the original value while allowing the type to change if it does not match
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def headOption(s: S): Option[A]
get the first target
get the first target
- Definition Classes
- Fold
- def index[I, A1](i: I)(implicit evIndex: Index[A, I, A1], evMonoS: =:=[S, T], evMonoA: =:=[A, B]): Optional[S, A1]
- def index[I, A1](i: I)(implicit evIndex: Index[A, I, A1]): Fold[S, A1]
- def isEmpty(s: S): Boolean
check if there is no target
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def lastOption(s: S): Option[A]
get the last target
get the last target
- Definition Classes
- Fold
- def length(s: S): Int
calculate the number of targets
calculate the number of targets
- Definition Classes
- Fold
- def mapping[F[_]](implicit arg0: Functor[F]): PIso[F[S], F[T], F[A], F[B]]
lift a PIso to a Functor level
- def modify(f: (A) => B): (S) => T
modify polymorphically the target of a PIso with a function
- def modifyA[F[_]](f: (A) => F[B])(s: S)(implicit arg0: Applicative[F]): F[T]
modify polymorphically the target of a PPrism with an Applicative function
modify polymorphically the target of a PPrism with an Applicative function
- Definition Classes
- PIso → PPrism → PLens → PTraversal
- def modifyF[F[_]](f: (A) => F[B])(s: S)(implicit arg0: Functor[F]): F[T]
modify polymorphically the target of a PIso with a Functor function
- def modifyOption(f: (A) => B): (S) => Option[T]
modify polymorphically the target of a POptional with a function.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def nonEmpty(s: S): Boolean
check if there is a target
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def orElse(other: POptional[S, T, A, B]): POptional[S, T, A, B]
fall-back to another POptional in case this one doesn't match
- def parModifyF[F[_]](f: (A) => F[B])(s: S)(implicit F: Parallel[F]): F[T]
PTraversal.modifyA for a
Parallel
applicative functor.PTraversal.modifyA for a
Parallel
applicative functor.- Definition Classes
- PTraversal
- def re: Getter[B, T]
create a Getter from the modified target to the modified source of a PPrism
- def replace(b: B): (S) => T
replace polymorphically the target of a PIso with a value
- def replaceOption(b: B): (S) => Option[T]
replace polymorphically the target of a POptional with a value.
- def some[A1, B1](implicit ev1: =:=[A, Option[A1]], ev2: =:=[B, Option[B1]]): PPrism[S, T, A1, B1]
- def some[A1](implicit ev1: =:=[A, Option[A1]]): Fold[S, A1]
- def split[S1, A1](other: Getter[S1, A1]): Getter[(S, S1), (A, A1)]
pair two disjoint Getter
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def to[C](f: (A) => C): Getter[S, C]
Compose with a function lifted into a Getter
- def toString(): String
- Definition Classes
- AnyRef → Any
- def unapply(obj: S): Some[A]
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def zip[A1](other: Getter[S, A1]): Getter[S, (A, A1)]
- Definition Classes
- Getter
Deprecated Value Members
- def first[C]: PIso[(S, C), (T, C), (A, C), (B, C)]
- def left[C]: PIso[Either[S, C], Either[T, C], Either[A, C], Either[B, C]]
- def right[C]: PIso[Either[C, S], Either[C, T], Either[C, A], Either[C, B]]
- def second[C]: PIso[(C, S), (C, T), (C, A), (C, B)]
- def set(b: B): (S) => T
alias to replace
alias to replace
- Definition Classes
- PSetter
- Annotations
- @deprecated
- Deprecated
(Since version 3.0.0-M1) use replace instead
- def setOption(b: B): (S) => Option[T]
alias to replaceOption
alias to replaceOption
- Definition Classes
- POptional
- Annotations
- @deprecated
- Deprecated
(Since version 3.0.0-M1) use replaceOption instead
- def split[S1, T1, A1, B1](other: PIso[S1, T1, A1, B1]): PIso[(S, S1), (T, T1), (A, A1), (B, B1)]
pair two disjoint PIso
pair two disjoint PIso
- Annotations
- @deprecated
- Deprecated
(Since version 3.0.0-M4) no replacement
- def split[S1, T1, A1, B1](other: PLens[S1, T1, A1, B1]): PLens[(S, S1), (T, T1), (A, A1), (B, B1)]
pair two disjoint PLens