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

Self Type
PIso[S, T, A, B]
Source
Iso.scala
See also

monocle.law.IsoLaws

Linear Supertypes
PPrism[S, T, A, B], PLens[S, T, A, B], Getter[S, A], POptional[S, T, A, B], PTraversal[S, T, A, B], Fold[S, A], PSetter[S, T, A, B], Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. PIso
  2. PPrism
  3. PLens
  4. Getter
  5. POptional
  6. PTraversal
  7. Fold
  8. PSetter
  9. Serializable
  10. AnyRef
  11. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def get(s: S): A

    get the target of a PLens

    get the target of a PLens

    Definition Classes
    PLensGetter
  2. abstract def reverse: PIso[B, A, T, S]

    reverse a PIso: the source becomes the target and the target becomes the source

  3. abstract def reverseGet(b: B): T

    get the modified source of a PPrism

    get the modified source of a PPrism

    Definition Classes
    PPrism

Concrete Value Members

  1. def all(p: (A) => Boolean): (S) => Boolean

    check if there is no target or the target satisfies the predicate

    check if there is no target or the target satisfies the predicate

    Definition Classes
    POptionalFold
  2. def andThen[C, D](other: PIso[A, B, C, D]): PIso[S, T, C, D]

    compose a PIso with another PIso

  3. def andThen[C, D](other: PPrism[A, B, C, D]): PPrism[S, T, C, D]

    compose a PPrism with another PPrism

    compose a PPrism with another PPrism

    Definition Classes
    PPrism
  4. def andThen[C, D](other: PLens[A, B, C, D]): PLens[S, T, C, D]

    compose a PLens with a PLens

    compose a PLens with a PLens

    Definition Classes
    PLens
  5. def andThen[B](other: Getter[A, B]): Getter[S, B]

    compose a Getter with a Getter

    compose a Getter with a Getter

    Definition Classes
    Getter
  6. def andThen[C, D](other: POptional[A, B, C, D]): POptional[S, T, C, D]

    compose a POptional with a POptional

    compose a POptional with a POptional

    Definition Classes
    POptional
  7. 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
  8. def andThen[B](other: Fold[A, B]): Fold[S, B]

    compose a Fold with another Fold

    compose a Fold with another Fold

    Definition Classes
    Fold
  9. def andThen[C, D](other: PSetter[A, B, C, D]): PSetter[S, T, C, D]

    compose a PSetter with another PSetter

    compose a PSetter with another PSetter

    Definition Classes
    PSetter
  10. 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
    Definition Classes
    PIsoPPrism
  11. 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
    Definition Classes
    PIsoPPrism
  12. def apply[C, D, E, F](c: C, d: D, e: E, f: F)(implicit ev: <~<[(C, D, E, F), B]): T
    Definition Classes
    PIsoPPrism
  13. def apply[C, D, E](c: C, d: D, e: E)(implicit ev: <~<[(C, D, E), B]): T
    Definition Classes
    PIsoPPrism
  14. def apply[C, D](c: C, d: D)(implicit ev: <~<[(C, D), B]): T
    Definition Classes
    PIsoPPrism
  15. def apply(b: B): T
    Definition Classes
    PIsoPPrism
  16. def apply()(implicit ev: Is[B, Unit]): T

    **********************************************************************

    **********************************************************************

    Definition Classes
    PIsoPPrism
  17. def asFold: Fold[S, A]

    view a PIso as a Fold

    view a PIso as a Fold

    Definition Classes
    PIsoPLensGetterPTraversal
  18. def asGetter: Getter[S, A]

    view a PLens as a Getter

    view a PLens as a Getter

    Definition Classes
    PLens
  19. def asLens: PLens[S, T, A, B]

    view a PIso as a PLens

  20. def asOptional: POptional[S, T, A, B]

    view a PIso as a POptional

    view a PIso as a POptional

    Definition Classes
    PIsoPPrismPLens
  21. def asPrism: PPrism[S, T, A, B]

    view a PIso as a PPrism

  22. def asSetter: PSetter[S, T, A, B]

    view a PIso as a Setter

    view a PIso as a Setter

    Definition Classes
    PIsoPTraversal
  23. def asTraversal: PTraversal[S, T, A, B]

    view a PIso as a PTraversal

    view a PIso as a PTraversal

    Definition Classes
    PIsoPOptional
  24. def choice[S1](other: Getter[S1, A]): Getter[Either[S, S1], A]

    join two Getter with the same target

    join two Getter with the same target

    Definition Classes
    Getter
  25. def exist(p: (A) => Boolean): (S) => Boolean

    check if the target satisfies the predicate

    check if the target satisfies the predicate

    Definition Classes
    PIsoPLensGetterPOptionalFold
  26. def find(p: (A) => Boolean): (S) => Option[A]

    find if the target satisfies the predicate

    find if the target satisfies the predicate

    Definition Classes
    PIsoPLensGetterPOptionalFold
  27. 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
  28. 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

    map each target to a Monoid and combine the results underlying representation of Fold, all Fold methods are defined in terms of foldMap

    Definition Classes
    PIsoPLensGetterPTraversalFold
  29. def getAll(s: S): List[A]

    get all the targets of a Fold

    get all the targets of a Fold

    Definition Classes
    Fold
  30. def getOption(s: S): Option[A]

    get the target of a POptional or nothing if there is no target

    get the target of a POptional or nothing if there is no target

    Definition Classes
    PLensPOptional
  31. 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

    get the target of a POptional or return the original value while allowing the type to change if it does not match

    Definition Classes
    PLensPOptional
  32. def headOption(s: S): Option[A]

    get the first target

    get the first target

    Definition Classes
    Fold
  33. def index[I, A1](i: I)(implicit evIndex: Index[A, I, A1], evMonoS: =:=[S, T], evMonoA: =:=[A, B]): Optional[S, A1]
    Definition Classes
    PIsoPPrismPLensPOptionalPTraversalPSetter
  34. def index[I, A1](i: I)(implicit evIndex: Index[A, I, A1]): Fold[S, A1]
    Definition Classes
    GetterFold
  35. def isEmpty(s: S): Boolean

    check if there is no target

    check if there is no target

    Definition Classes
    POptionalFold
  36. def lastOption(s: S): Option[A]

    get the last target

    get the last target

    Definition Classes
    Fold
  37. def length(s: S): Int

    calculate the number of targets

    calculate the number of targets

    Definition Classes
    Fold
  38. def mapping[F[_]](implicit arg0: Functor[F]): PIso[F[S], F[T], F[A], F[B]]

    lift a PIso to a Functor level

  39. def modify(f: (A) => B): (S) => T

    modify polymorphically the target of a PIso with a function

    modify polymorphically the target of a PIso with a function

    Definition Classes
    PIsoPPrismPLensPTraversalPSetter
  40. 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
    PIsoPPrismPLensPTraversal
  41. 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

    modify polymorphically the target of a PIso with a Functor function

    Definition Classes
    PIsoPLens
  42. def modifyOption(f: (A) => B): (S) => Option[T]

    modify polymorphically the target of a POptional with a function.

    modify polymorphically the target of a POptional with a function. return empty if the POptional is not matching

    Definition Classes
    POptional
  43. def nonEmpty(s: S): Boolean

    check if there is a target

    check if there is a target

    Definition Classes
    POptionalFold
  44. 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

    fall-back to another POptional in case this one doesn't match

    Definition Classes
    POptional
  45. 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
  46. def re: Getter[B, T]

    create a Getter from the modified target to the modified source of a PPrism

    create a Getter from the modified target to the modified source of a PPrism

    Definition Classes
    PPrism
  47. def replace(b: B): (S) => T

    replace polymorphically the target of a PIso with a value

    replace polymorphically the target of a PIso with a value

    Definition Classes
    PIsoPPrismPLensPOptionalPTraversalPSetter
  48. def replaceOption(b: B): (S) => Option[T]

    replace polymorphically the target of a POptional with a value.

    replace polymorphically the target of a POptional with a value. return empty if the POptional is not matching

    Definition Classes
    POptional
  49. def some[A1, B1](implicit ev1: =:=[A, Option[A1]], ev2: =:=[B, Option[B1]]): PPrism[S, T, A1, B1]
    Definition Classes
    PIsoPPrismPLensPOptionalPTraversalPSetter
  50. def some[A1](implicit ev1: =:=[A, Option[A1]]): Fold[S, A1]
    Definition Classes
    GetterFold
  51. def split[S1, A1](other: Getter[S1, A1]): Getter[(S, S1), (A, A1)]

    pair two disjoint Getter

    pair two disjoint Getter

    Definition Classes
    Getter
  52. def to[C](f: (A) => C): Getter[S, C]

    Compose with a function lifted into a Getter

    Compose with a function lifted into a Getter

    Definition Classes
    PIsoPLensGetterFold
  53. def unapply(obj: S): Some[A]
    Definition Classes
    PIsoPPrism
  54. def zip[A1](other: Getter[S, A1]): Getter[S, (A, A1)]
    Definition Classes
    Getter

Deprecated Value Members

  1. def first[C]: PIso[(S, C), (T, C), (A, C), (B, C)]
    Definition Classes
    PIsoPPrismPLensGetterPOptional
    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0-M4) no replacement

  2. def left[C]: PIso[Either[S, C], Either[T, C], Either[A, C], Either[B, C]]
    Definition Classes
    PIsoPPrismGetterFold
    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0-M4) no replacement

  3. def right[C]: PIso[Either[C, S], Either[C, T], Either[C, A], Either[C, B]]
    Definition Classes
    PIsoPPrismGetterFold
    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0-M4) no replacement

  4. def second[C]: PIso[(C, S), (C, T), (C, A), (C, B)]
    Definition Classes
    PIsoPPrismPLensGetterPOptional
    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0-M4) no replacement

  5. 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

  6. 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

  7. 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

  8. 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

    pair two disjoint PLens

    Definition Classes
    PLens
    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0-M4) no replacement