Idris2Doc : Monocle.Optional

Monocle.Optional

(source)

Definitions

recordOptional : Type->Type->Type->Type->Type
  An Optional allows us to focus on a single piece of
information in a larger data object that might or might not
be there.

An Optional is related to but less powerful than a Prism, because
it does not allow us to directly inject a value into a larger data
object, but only supports updating such a value if it exists.

Optionals play an important role when we sequentially combine different
types of optics: The sequential composition of a Lens with a Prism or
vice verca results in an optional: We can no longer be certain that
the value we focus on is still there (the Prism prevents that), nor can
we directly inject the value into the larger data object
(the Lens prevents that).

Totality: total
Visibility: public export
Constructor: 
O : (s->Eitherta) -> ((a->b) ->s->t) ->Optionalstab

Projections:
.getOrModify : Optionalstab->s->Eitherta
.replace : Optionalstab-> (a->b) ->s->t

Hints:
OSeqIsoOptionalOptional
OSeqLensPrismOptional
OSeqLensOptionalOptional
OSeqPrismLensOptional
OSeqPrismOptionalOptional
OSeqOptionalOptionalOptional
OSeqOptionalIsoOptional
OSeqOptionalLensOptional
OSeqOptionalPrismOptional
OSeqOptionalTraversalTraversal
OSeqOptionalGetterFold
OSeqOptionalSetterSetter
OSeqOptionalFoldFold
OSeqTraversalOptionalTraversal
OSeqSetterOptionalSetter
OSeqGetterOptionalFold
OSeqFoldOptionalFold
ToFoldOptional
ToOptionalOptional
ToSetterOptional
ToTraversalOptional
.getOrModify : Optionalstab->s->Eitherta
Totality: total
Visibility: public export
getOrModify : Optionalstab->s->Eitherta
Totality: total
Visibility: public export
.replace : Optionalstab-> (a->b) ->s->t
Totality: total
Visibility: public export
replace : Optionalstab-> (a->b) ->s->t
Totality: total
Visibility: public export
0Optional' : Type->Type->Type
  Convenience alias for monomorphic Optionals, which do not allow
us to change the value and source types.

Totality: total
Visibility: public export
optional : (s->Maybea) -> ((a->a) ->s->s) ->Optional'sa
  Utility constructor for monomorphic optionals.

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

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

Parameters: o
Methods:
toOptional : ostab->Optionalstab

Implementations:
ToOptionalIso
ToOptionalLens
ToOptionalOptional
ToOptionalPrism
toOptional : ToOptionalo=>ostab->Optionalstab
Totality: total
Visibility: public export
(~>) : Optionalstab->Optionalabcd->Optionalstcd
  Sequential composition of Optionals.

Totality: total
Visibility: public export
Fixity Declaration: infixl operator, level 0
emptyO : Optional'sa
  The empty Optional, which does not focus on anything at all.

Totality: total
Visibility: public export
getIx : Nat->Lista->Maybea
  Tries to extract a value at the given index from a List.

Totality: total
Visibility: public export
modIx : Nat-> (a->a) ->Lista->Lista
  Modifies the value at the given index in a List.

Returns the unchanged List if the index is out of bounds.

Totality: total
Visibility: public export
ix : Nat->Optional' (Lista) a
  An Optional focussing on the n-th element in a List.

Totality: total
Visibility: public export
select : (a->Bool) ->Optional'aa
  An Optional for focussing on those values that fulfill a given
predicate.

Totality: total
Visibility: public export
eqBy : Eqb=>b-> (a->b) ->Optional'aa
  An Optional for focussing on those values that are equivalent to `v`
according to the given comparison function.

Totality: total
Visibility: public export
modWhere : SnocLista-> (a->Bool) -> (a->a) ->Lista->Lista
Totality: total
Visibility: public export
first : (a->Bool) ->Optional' (Lista) a
  An Optional for focussing on the first value in a list
that fulfills the given predicate.

Totality: total
Visibility: public export
eqFirst : Eqb=>b-> (a->b) ->Optional' (Lista) a
  An Optional for focussing on the first value in a List
that is equivalent to `v` according to the given comparison function.

Totality: total
Visibility: public export
stO : Applicativem=>Monoidx=>Optional'ts->StateTsmx->StateTtmx
  View a stateful computation resulting in a monoid through an
optional.

Totality: total
Visibility: export