Idris2Doc : Control.Lens.Lens

Control.Lens.Lens

(source)

Definitions

recordIsLens : (Type->Type->Type) ->Type
Totality: total
Visibility: public export
Constructor: 
MkIsLens : Strongp->IsLensp

Projection: 
.runIsLens : IsLensp->Strongp

Hints:
IsLensp=>IsIsop
IsGetterp=>IsLensp
IsOptionalp=>IsLensp
IsLensp=>IsLens (Indexedip)
.runIsLens : IsLensp->Strongp
Totality: total
Visibility: public export
runIsLens : IsLensp->Strongp
Totality: total
Visibility: public export
lensToIso : IsLensp=>IsIsop
Totality: total
Visibility: export
indexedLens : IsLensp=>IsLens (Indexedip)
Totality: total
Visibility: export
0Lens : Type->Type->Type->Type->Type
  A *lens* is a functional reference to a value within a larger data structure.
Lenses allow one to access or modify the value that they reference, called
the "focus" or "focus element".

For example, the lens `fst_` from `Data.Tuple.Lens` focuses on the first
element of a pair. It has the type:

```idris
fst_ : Lens (a, c) (b, c) a b
```

The types `s, t` correspond to the type of the outside data structure, and
`a, b` correspond to the type of the focus element. Two of each type is
provided to allow for operations that change the type of the focus.

Totality: total
Visibility: public export
0Lens' : Type->Type->Type
  `Lens'` is the `Simple` version of `Lens`.

Totality: total
Visibility: public export
0IndexedLens : Type->Type->Type->Type->Type->Type
  An indexed lens allows access to the index of a focus while setting it.

Any indexed lens can be coerced into a regular lens and used in normal lens
functions, but there are also special functions that take indexed lenses
(i.e. `iover` instead of `over`).

Totality: total
Visibility: public export
0IndexedLens' : Type->Type->Type->Type
  `IndexedLens'` is the `Simple` version of `IndexedLens`.

Totality: total
Visibility: public export
lens : (s->a) -> (s->b->t) ->Lensstab
  Construct a lens given getter and setter functions.

@ get The getter function
@ set The setter function, where the first argument is the data structure
to modify and the second argument is the new focus value

Totality: total
Visibility: public export
ilens : (s-> (i, a)) -> (s->b->t) ->IndexedLensistab
  Construct an indexed lens given getter and setter functions.

Totality: total
Visibility: public export
getLens : Lensstab-> (s->a, s->b->t)
  Extract getter and setter functions from a lens.

Totality: total
Visibility: public export
withLens : Lensstab-> ((s->a) -> (s->b->t) ->r) ->r
  Extract getter and setter functions from a lens.

Totality: total
Visibility: public export
devoid : IndexedLensiVoidtab
  `Void` vacuously "contains" a value of any other type.

Totality: total
Visibility: public export
united : Lens'a ()
  All values contain a unit.

Totality: total
Visibility: public export
alongside : Lensstab->Lenss't'a'b'->Lens (s, s') (t, t') (a, a') (b, b')
  Create a lens that operates on pairs from two other lenses.

Totality: total
Visibility: public export
fusing : IsIsop=>Optic' (Yonedap) stab->Optic'pstab
  Optimize a composition of optics by fusing their uses of `dimap` into one.

This function exploits the Yoneda lemma. `fusing (a . b)` is essentially
equivalent to `a . b`, but the former will only call `dimap` once.

Totality: total
Visibility: public export
(%%~) : Functorf=>Lensstab-> (a->fb) ->s->ft
Totality: total
Visibility: public export
Fixity Declaration: infixr operator, level 4
(%%=) : MonadStatesm=>Lensssab-> (a-> (r, b)) ->mr
Totality: total
Visibility: public export
Fixity Declaration: infixr operator, level 4
(%%@~) : Functorf=>IndexedLensistab-> (i->a->fb) ->s->ft
Totality: total
Visibility: public export
Fixity Declaration: infixr operator, level 4
(%%@=) : MonadStatesm=>IndexedLensissab-> (i->a-> (r, b)) ->mr
Totality: total
Visibility: public export
Fixity Declaration: infixr operator, level 4
(<%~) : Lensstab-> (a->b) ->s-> (b, t)
  Modify a value with pass-through.

Totality: total
Visibility: public export
Fixity Declaration: infixr operator, level 4
(<%@~) : IndexedLensistab-> (i->a->b) ->s-> (b, t)
  Modify a value with pass-through, having access to the index.

Totality: total
Visibility: public export
Fixity Declaration: infixr operator, level 4
(<+~) : Numa=>Lensstaa->a->s-> (a, t)
  Add a value to the lens with pass-through.

Totality: total
Visibility: public export
Fixity Declaration: infixr operator, level 4
(<*~) : Numa=>Lensstaa->a->s-> (a, t)
  Multiply the lens by a value with pass-through.

Totality: total
Visibility: public export
Fixity Declaration: infixr operator, level 4
(<-~) : Nega=>Lensstaa->a->s-> (a, t)
  Subtract a value from the lens with pass-through.

Totality: total
Visibility: public export
Fixity Declaration: infixr operator, level 4
(</~) : Fractionala=>Lensstaa->a->s-> (a, t)
  Divide the lens by a value with pass-through.

Totality: total
Visibility: public export
Fixity Declaration: infixr operator, level 4
(<||~) : LensstBoolBool-> Lazy Bool->s-> (Bool, t)
  Logically OR the lens with a constant value with pass-through.

Like (||) and (||~), this operator takes a lazy second argument.

Totality: total
Visibility: public export
Fixity Declaration: infixr operator, level 4
(<&&~) : LensstBoolBool-> Lazy Bool->s-> (Bool, t)
  Logically AND the lens with a constant value with pass-through.

Like (&&) and (&&~), this operator takes a lazy second argument.

Totality: total
Visibility: public export
Fixity Declaration: infixr operator, level 4
(<<+>~) : Semigroupa=>Lensstaa->a->s-> (a, t)
  Modify an lens's focus with the semigroup/monoid operator with pass-through.

The constant value is applied to the focus from the right:
```
l <<+>~ x = l <%~ (<+> x)
```

Totality: total
Visibility: public export
Fixity Declaration: infixr operator, level 4
(<<%~) : Lensstab-> (a->b) ->s-> (a, t)
  Modify the value of a lens and return the old value.

Totality: total
Visibility: public export
Fixity Declaration: infixr operator, level 4
(<<.~) : Lensstab->b->s-> (a, t)
  Set the value of a lens and return the old value.

Totality: total
Visibility: public export
Fixity Declaration: infixr operator, level 4
(<<?~) : Lenssta (Maybeb) ->b->s-> (a, t)
  Set a lens to `Just` a value and return the old value.

Totality: total
Visibility: public export
Fixity Declaration: infixr operator, level 4
(<<+~) : Numa=>Lensstaa->a->s-> (a, t)
  Add a constant value to a lens's focus and return the old value.

Totality: total
Visibility: public export
Fixity Declaration: infixr operator, level 4
(<<*~) : Numa=>Lensstaa->a->s-> (a, t)
  Multiply a lens's focus by a constant value and return the old value.

Totality: total
Visibility: public export
Fixity Declaration: infixr operator, level 4
(<<-~) : Nega=>Lensstaa->a->s-> (a, t)
  Subtract a constant value from a lens's focus and return the old value.

Totality: total
Visibility: public export
Fixity Declaration: infixr operator, level 4
(<</~) : Fractionala=>Lensstaa->a->s-> (a, t)
  Divide a lens's focus by a constant value and return the old value.

Totality: total
Visibility: public export
Fixity Declaration: infixr operator, level 4
(<<||~) : LensstBoolBool-> Lazy Bool->s-> (Bool, t)
  Logically OR a lens's focus by a constant value and return the old value.

Like (||) and (||~), this operator takes a lazy second argument.

Totality: total
Visibility: public export
Fixity Declaration: infixr operator, level 4
(<<&&~) : LensstBoolBool-> Lazy Bool->s-> (Bool, t)
  Logically AND a lens's focus by a constant value and return the old value.

Like (&&) and (&&~), this operator takes a lazy second argument.

Totality: total
Visibility: public export
Fixity Declaration: infixr operator, level 4
(<<<+>~) : Semigroupa=>Lensstaa->a->s-> (a, t)
  Modify a lens's focus using the semigroup/monoid operator and return the
old value.

The constant value is applied to the focus from the right:
```
l <<<+>~ x = l <<%~ (<+> x)
```

Totality: total
Visibility: public export
Fixity Declaration: infixr operator, level 4
(<%=) : MonadStatesm=>Lensssab-> (a->b) ->mb
  Modify within a state monad with pass-through.

Totality: total
Visibility: public export
Fixity Declaration: infix operator, level 4
(<%@=) : MonadStatesm=>IndexedLensissab-> (i->a->b) ->mb
  Modify within a state monad with pass-through, having access to the index.

Totality: total
Visibility: public export
Fixity Declaration: infix operator, level 4
(<+=) : Numa=>MonadStatesm=>Lens'sa->a->ma
  Add a value to the lens into state with pass-through.

Totality: total
Visibility: public export
Fixity Declaration: infix operator, level 4
(<*=) : Numa=>MonadStatesm=>Lens'sa->a->ma
  Multiply a lens's focus into state by a constant value with pass-through.

Totality: total
Visibility: public export
Fixity Declaration: infix operator, level 4
(<-=) : Nega=>MonadStatesm=>Lens'sa->a->ma
  Subtract a value from the lens into state with pass-through.

Totality: total
Visibility: public export
Fixity Declaration: infix operator, level 4
(</=) : Fractionala=>MonadStatesm=>Lens'sa->a->ma
  Divide a lens's focus into state by a constant value with pass-through.

Totality: total
Visibility: public export
Fixity Declaration: infix operator, level 4
(<||=) : MonadStatesm=>LensssBoolBool-> Lazy Bool->mBool
  Logically OR a lens's focus into state with a constant value with pass-through.

Totality: total
Visibility: public export
Fixity Declaration: infix operator, level 4
(<&&=) : MonadStatesm=>LensssBoolBool-> Lazy Bool->mBool
  Logically AND a lens's focus into state with a constant value with pass-through.

Totality: total
Visibility: public export
Fixity Declaration: infix operator, level 4
(<<+>=) : MonadStatesm=>Semigroupa=>Lens'sa->a->ma
  Modify a lens's focus into state using a semigroup operation with pass-through.

Totality: total
Visibility: public export
Fixity Declaration: infix operator, level 4
(<<%=) : MonadStatesm=>Lensssab-> (a->b) ->ma
  Modify the value of a lens into state and return the old value.

Totality: total
Visibility: public export
Fixity Declaration: infix operator, level 4
(<<%@=) : MonadStatesm=>IndexedLensissab-> (i->a->b) ->ma
  Modify the value of an indexed lens into state and return the old value.

Totality: total
Visibility: public export
Fixity Declaration: infix operator, level 4
(<<.=) : MonadStatesm=>Lensssab->b->ma
  Set the value of a lens into state and return the old value.

Totality: total
Visibility: public export
Fixity Declaration: infix operator, level 4
(<<?=) : MonadStatesm=>Lensssa (Maybeb) ->b->ma
  Set a lens into state to `Just` a value and return the old value.

Totality: total
Visibility: public export
Fixity Declaration: infix operator, level 4
(<<+=) : Numa=>MonadStatesm=>Lens'sa->a->ma
  Add a value to the lens into state and return the old value.

Totality: total
Visibility: public export
Fixity Declaration: infix operator, level 4
(<<*=) : Numa=>MonadStatesm=>Lens'sa->a->ma
  Multiply a lens's focus into state by a constant value and return the old
value.

Totality: total
Visibility: public export
Fixity Declaration: infix operator, level 4
(<<-=) : Nega=>MonadStatesm=>Lens'sa->a->ma
  Subtract a value from the lens into state and return the old value.

Totality: total
Visibility: public export
Fixity Declaration: infix operator, level 4
(<</=) : Fractionala=>MonadStatesm=>Lens'sa->a->ma
  Divide a lens's focus into state by a constant value and return the old
value.

Totality: total
Visibility: public export
Fixity Declaration: infix operator, level 4
(<<||=) : MonadStatesm=>LensssBoolBool-> Lazy Bool->mBool
  Logically OR a lens's focus into state with a constant value and return the
old value.

Totality: total
Visibility: public export
Fixity Declaration: infix operator, level 4
(<<&&=) : MonadStatesm=>LensssBoolBool-> Lazy Bool->mBool
  Logically AND a lens's focus into state with a constant value and return the
old value.

Totality: total
Visibility: public export
Fixity Declaration: infix operator, level 4
(<<<+>=) : MonadStatesm=>Semigroupa=>Lens'sa->a->ma
  Modify a lens's focus into state using a semigroup operation and return the
old value.

Totality: total
Visibility: public export
Fixity Declaration: infix operator, level 4
(<<<~) : MonadStatesm=>Lensssab->mb->ma
  Run a monadic action and set the focus of an optic in state to the result.
This is different from `(<~)` and `(<<~)` in that it also passes though
the old value of the optic.

Totality: total
Visibility: public export
Fixity Declaration: infixr operator, level 1