Idris2Doc : Monocle.Prism

Monocle.Prism

(source)

Definitions

recordPrism : Type->Type->Type->Type->Type
  A Prism is the categorical dual of a Lens: While a Lens allows
us to extract values from a larger type, a Prism allows us to inject
values into a larger type, while extracting such a value might not
be possible.

Prisms are therefore a natural fit for inspecting sum types,
(as opposed to lenses, which are preferrably used for product types),
where we typically have one Prism per data constructor.

An other use case where Prisms shine are refinement type, where
"injecting" a value means extracting a value of the parent type from
refinement type. An example for this is the `nat` Prism, which allows
us to convert ("inject") a `Nat` into an `Integer`, while extracting a
`Nat` from an `Integer` might fail.

A Prism is parameterized over four parameters, because in general
we can not only try and extract a value from some object
but also refine the object in case extraction fails.
Consider lens `fst`, where `s` corresponds to `(a,c)` and
`t` corresponds to `(b,c)`. Accordingly, if we have a function from
`a` to `b`, we can convert a pair of type `(a,c)` to one of type `(b,c)`.

Totality: total
Visibility: public export
Constructor: 
P : (s->Eitherta) -> (b->t) ->Prismstab

Projections:
.getOrModify : Prismstab->s->Eitherta
.reverseGet : Prismstab->b->t

Hints:
OSeqIsoPrismPrism
OSeqLensPrismOptional
OSeqPrismPrismPrism
OSeqPrismIsoPrism
OSeqPrismLensOptional
OSeqPrismOptionalOptional
OSeqPrismTraversalTraversal
OSeqPrismGetterFold
OSeqPrismSetterSetter
OSeqPrismFoldFold
OSeqOptionalPrismOptional
OSeqTraversalPrismTraversal
OSeqSetterPrismSetter
OSeqGetterPrismFold
OSeqFoldPrismFold
ToFoldPrism
ToOptionalPrism
ToPrismPrism
ToSetterPrism
ToTraversalPrism
.getOrModify : Prismstab->s->Eitherta
Totality: total
Visibility: public export
getOrModify : Prismstab->s->Eitherta
Totality: total
Visibility: public export
.reverseGet : Prismstab->b->t
Totality: total
Visibility: public export
reverseGet : Prismstab->b->t
Totality: total
Visibility: public export
0Prism' : Type->Type->Type
  Convenience alias for monomorphic Prisms, which do not allow
us to change the value and source types.

Totality: total
Visibility: public export
prism : (a->Maybeb) -> (b->a) ->Prism'ab
  Convenience constructor for monomorphic Prisms.

Totality: total
Visibility: public export
mapA : Applicativef=>Prismstab-> (a->fb) ->s->ft
  Adjust the focus of a Prism with an effectful computation.

Totality: total
Visibility: public export
interfaceToPrism : (Type->Type->Type->Type->Type) ->Type
  Interface for converting other optics to Prisms.

Parameters: o
Methods:
toPrism : ostab->Prismstab

Implementations:
ToPrismIso
ToPrismPrism
toPrism : ToPrismo=>ostab->Prismstab
Totality: total
Visibility: public export
(~>) : Prismstab->Prismabcd->Prismstcd
  Sequential composition of Prisms.

Totality: total
Visibility: public export
Fixity Declaration: infixl operator, level 0
left' : Prism (Eitherab) (Eithercb) ac
  A Prism focussing on the `Left` data constructor of `Either a b`.

Totality: total
Visibility: public export
left : Prism' (Eitherab) a
  Monomorphic version of `left'`.

This can improve type inference for those cases where the versatility
of `left'` is not needed.

Totality: total
Visibility: public export
right' : Prism (Eitherab) (Eitherac) bc
  A Prism focussing on the `Right` data constructor of `Either a b`.

Totality: total
Visibility: public export
right : Prism' (Eitherab) b
  Monomorphic version of `right'`.

This can improve type inference for those cases where the versatility
of `right'` is not needed.

Totality: total
Visibility: public export
just' : Prism (Maybea) (Maybeb) ab
  A Prism focussing on the `Just` data constructor of a `Maybe`.

Totality: total
Visibility: public export
just : Prism' (Maybea) a
  Monomorphic version of `just'`.

This can improve type inference for those cases where the versatility
of `just'` is not needed.

Totality: total
Visibility: public export
nothing : Prism' (Maybea) ()
  A Prism focussing on the `Nothing` data constructor of a `Maybe`.

Totality: total
Visibility: public export
cons' : Prism (Lista) (Listb) (a, Lista) (b, Listb)
  A Prism focussing on the `(::)` ("cons") data constructor of a
`List`.

Totality: total
Visibility: public export
nil : Prism' (Lista) ()
  A Prism focussing on the `Nil` data constructor of a
`List`.

Totality: total
Visibility: public export
cons : Prism' (Lista) (a, Lista)
  Monomorphic version of `cons'`.

This can improve type inference for those cases where the versatility
of `cons'` is not needed.

Totality: total
Visibility: public export
snoc' : Prism (SnocLista) (SnocListb) (SnocLista, a) (SnocListb, b)
  A Prism focussing on the `(:<)` ("snoc") data constructor of a
`SnocList`.

Totality: total
Visibility: public export
lin : Prism' (SnocLista) ()
  A Prism focussing on the `Lin` data constructor of a
`SnocList`.

Totality: total
Visibility: public export
snoc : Prism' (SnocLista) (SnocLista, a)
  Monomorphic version of `snoc'`.

This can improve type inference for those cases where the versatility
of `snoc'` is not needed.

Totality: total
Visibility: public export
list1' : Prism (Lista) (Listb) (List1a) (List1b)
  A Prism for converting between non-empty lists and regular lists.

Totality: total
Visibility: public export
list1 : Prism' (Lista) (List1a)
Totality: total
Visibility: public export
sum : (0t : k) ->Elemtks=>Prism' (Anyfks) (ft)
  A Prism focussing on a single option in a heterogeneous sum.

Totality: total
Visibility: public export
anyHead : Prism' (Anyf (k::ks)) (fk)
Totality: total
Visibility: public export
anyTail : Prism' (Anyf (k::ks)) (Anyfks)
Totality: total
Visibility: public export
nat : Prism'IntegerNat
  A Prism focussing on non-negative integers.

Totality: total
Visibility: public export