Idris2Doc : Control.Zipper

Control.Zipper

(source)
A system for type-safe, traversal-based zippers into arbitrary datatypes.

Definitions

dataZipLayer : Type
  A simple type that represents a layer of the zipper as it moves downwards.

It also carries an index for that particular layer, if an indexed lens was
used to create it.

Totality: total
Visibility: public export
Constructor: 
(@>) : Type->Type->ZipLayer
getTy : ZipLayer->Type
  Get the type from a layer of a zipper.

Totality: total
Visibility: public export
dataZipper : ListZipLayer->Type->Type->Type
  A zipper is a temporary data structure that can be "opened" on a particular
value, and allows one to move through its structure and operate on any
part of it.
A zipper can be opened from *any* value using `zipper`.

Rather than being defined for a particular data structure, this zipper type
uses lenses to traverse through its value. The zipper can be moved down
through a traversal or lens, up out of one, or left and right between the
focuses of a traversal.

You can use `rezip` to repackage the zipper back into a regular value.

Totality: total
Visibility: export
Constructor: 
MkZipper : Coilhsia->Pointeria->i->a->Zipperhsia
zipper : a->Zipper [] () a
  Open a zipper from a value.

Totality: total
Visibility: export
focus : IndexedLens'i (Zipperhsia) a
  A lens that points to the current focus of the zipper.

Totality: total
Visibility: export
upward : Zipper ((j@>s) ::hs) ia->Zipperhsjs
  Move up a layer of the zipper.

Totality: total
Visibility: export
tug : (a->Maybea) ->a->a
  Perform an action on a zipper, but leave the zipper's state unchanged if the
action fails.

This is intended to be used as `tug rightward`, `tug leftward`, etc.

Totality: total
Visibility: export
rightward : Alternativef=>Zipperhsia->f (Zipperhsia)
  Move right one value in the current layer. This will fail if already at the
rightmost value.

Totality: total
Visibility: export
leftward : Alternativef=>Zipperhsia->f (Zipperhsia)
  Move left one value in the current layer. This will fail if already at the
leftmost value.

Totality: total
Visibility: export
rightmost : Zipperhsia->Zipperhsia
  Move to the rightmost value in the current layer.

Totality: total
Visibility: export
leftmost : Zipperhsia->Zipperhsia
  Move to the leftmost value in the current layer.

Totality: total
Visibility: export
idownward : IndexedLens'isa->Zipperhsjs->Zipper ((j@>s) ::hs) ia
  Move downward through an indexed lens.

This cannot fail, since a lens always contains a value.

Totality: total
Visibility: export
downward : Lens'sa->Zipperhsjs->Zipper ((j@>s) ::hs) () a
  Move downward through a lens.

This cannot fail, since a lens always contains a value.

Totality: total
Visibility: export
iwithin : Alternativef=>IndexedTraversal'isa->Zipperhsjs->f (Zipper ((j@>s) ::hs) ia)
  Move downward through an indexed traversal. This will fail if the traversal
has no focuses.

If the traversal has multiple values, the zipper will focus on the leftmost one.

Totality: total
Visibility: export
within : Alternativef=>Traversal'sa->Zipperhsjs->f (Zipper ((j@>s) ::hs) Nata)
  Move downward through a traversal. This will fail if the traversal has no
focuses.

If the traversal has multiple values, the zipper will focus on the leftmost one.

Totality: total
Visibility: export
rezip : Zipperhsia->getTy (last ((i@>a) ::hs))
  Close a zipper, repackaging it back into a value of its original type.

Totality: total
Visibility: export