scalaz

PLensT

sealed trait PLensT[F[+_], A, B] extends AnyRef

Partial Lens, offering a purely functional means to access and retrieve an optional field of type B in a record of type A.

This structure is more general than the one described in http://days2012.scala-lang.org/sites/days2012/files/morris_lenses.pdf as it abstracts over a type constructor F, used to address the field, and G, used to wrap the value of the field.

If F and G as taken to be scalaz.Id, the structure simplifies to the partial lens presented in the paper.

The term field should not be interpreted restrictively to mean a member of a class. For example, a partial lens can address the nth element of a List.

F

Type constructor used to address the field

A

The type of the record

B

The type of the optional field

Source
PLens.scala
See also

scalaz.LensT

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. PLensT
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def run(a: A): F[Option[Store[B, A]]]

Concrete Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def %%=[C](s: State[B, C])(implicit F: Functor[F]): PStateT[F, A, C]

  5. def %=(f: (B) ⇒ B)(implicit F: Functor[F]): PStateT[F, A, B]

  6. def %==(f: (B) ⇒ B)(implicit F: Functor[F]): StateT[F, A, Unit]

  7. def ***[C, D](that: PLensT[F, C, D])(implicit FF: Apply[F]): PLensT[F, (A, C), (B, D)]

    alias for product

  8. def ->>-[C](f: ⇒ StateT[F, A, C])(implicit F: Monad[F]): PStateT[F, A, C]

  9. def :=(b: ⇒ B)(implicit F: Functor[F]): PStateT[F, A, B]

  10. def <=<[C](that: PLensT[F, C, A])(implicit FF: Monad[F]): PLensT[F, C, B]

    alias for compose

  11. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  12. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  13. def =>=(f: (B) ⇒ B)(implicit F: Functor[F]): (A) ⇒ F[A]

  14. def >-[C](f: (B) ⇒ C)(implicit F: Functor[F]): PStateT[F, A, C]

  15. def >=>[C](that: PLensT[F, B, C])(implicit FF: Monad[F]): PLensT[F, A, C]

    alias for andThen

  16. def >>-[C](f: (B) ⇒ StateT[F, A, C])(implicit F: Monad[F]): PStateT[F, A, C]

  17. def andThen[C](that: PLensT[F, B, C])(implicit FF: Monad[F]): PLensT[F, A, C]

  18. def apply(a: A): F[Option[Store[B, A]]]

  19. def as(f: (B) ⇒ A, a: A)(implicit F: Functor[F]): F[A]

    If the PartialLens is null, then return the target object, otherwise run the function on its projection.

  20. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  21. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  22. def compose[C](that: PLensT[F, C, A])(implicit FF: Monad[F]): PLensT[F, C, B]

    Lenses can be composed

  23. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  24. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  25. def exists(p: (B) ⇒ Boolean, a: A)(implicit F: Functor[F]): F[Boolean]

  26. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  27. def forall(p: (B) ⇒ Boolean, a: A)(implicit F: Functor[F]): F[Boolean]

  28. def get(a: A)(implicit F: Functor[F]): F[Option[B]]

  29. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  30. def getK(implicit F: Functor[F]): Kleisli[[+α]OptionT[F, α], A, B]

  31. def getO(a: A)(implicit F: Functor[F]): OptionT[F, B]

  32. def getOr(a: A, b: ⇒ B)(implicit F: Functor[F]): F[B]

    If the PartialLens is null, then return the given default value.

  33. def getOrZ(a: A)(implicit M: Monoid[B], F: Functor[F]): F[B]

  34. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  35. def is(a: A)(implicit F: Functor[F]): F[Boolean]

  36. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  37. def isNot(a: A)(implicit F: Functor[F]): F[Boolean]

  38. def kleisli: Kleisli[[+α]OptionT[F, α], A, Store[B, A]]

  39. def mapC[C](f: (Store[B, A]) ⇒ Store[C, A])(implicit F: Functor[F]): PLensT[F, A, C]

  40. def mod(f: (B) ⇒ B, a: A)(implicit F: Functor[F]): F[A]

    Modify the value viewed through the lens

  41. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  42. final def notify(): Unit

    Definition Classes
    AnyRef
  43. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  44. def product[C, D](that: PLensT[F, C, D])(implicit FF: Apply[F]): PLensT[F, (A, C), (B, D)]

    Two disjoint lenses can be paired

  45. def runO(a: A): OptionT[F, Store[B, A]]

  46. def set(a: A, b: B)(implicit F: Functor[F]): F[Option[A]]

  47. def setK(a: A)(implicit F: Functor[F]): Kleisli[[+α]OptionT[F, α], B, A]

  48. def setO(a: A, b: B)(implicit F: Functor[F]): OptionT[F, A]

  49. def setOr(a: A, b: B, d: ⇒ A)(implicit F: Functor[F]): F[A]

  50. def setOrZ(a: A, b: B)(implicit M: Monoid[A], F: Functor[F]): F[A]

  51. def st(implicit F: Functor[F]): PStateT[F, A, B]

  52. def sum[C](that: ⇒ PLensT[F, C, B])(implicit F: Functor[F]): PLensT[F, \/[A, C], B]

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

  53. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  54. def toString(): String

    Definition Classes
    AnyRef → Any
  55. def trySet(a: A)(implicit F: Functor[F]): F[Option[(B) ⇒ A]]

  56. def trySetK(implicit F: Functor[F]): Kleisli[[+α]OptionT[F, α], A, (B) ⇒ A]

  57. def trySetO(a: A)(implicit F: Functor[F]): OptionT[F, (B) ⇒ A]

  58. def trySetOr(a: A, d: ⇒ (B) ⇒ A)(implicit F: Functor[F]): F[(B) ⇒ A]

  59. def trySetOrZ(a: A)(implicit M: Monoid[(B) ⇒ A], F: Functor[F]): F[(B) ⇒ A]

  60. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  61. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  62. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  63. def xmapA[X](f: (A) ⇒ X)(g: (X) ⇒ A)(implicit F: Functor[F]): PLensT[F, X, B]

  64. def xmapB[X](f: (B) ⇒ X)(g: (X) ⇒ B)(implicit F: Functor[F]): PLensT[F, A, X]

  65. def xmapbA[X](b: BijectionT.Bijection[A, X])(implicit F: Functor[F]): PLensT[F, X, B]

  66. def xmapbB[X](b: BijectionT.Bijection[B, X])(implicit F: Functor[F]): PLensT[F, A, X]

  67. def |||[C](that: ⇒ PLensT[F, C, B])(implicit F: Functor[F]): PLensT[F, \/[A, C], B]

    Alias for sum

Inherited from AnyRef

Inherited from Any

Ungrouped