data ZipLayer : 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 exportdata Zipper : List ZipLayer -> 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 : Coil hs i a -> Pointer i a -> i -> a -> Zipper hs i a
zipper : a -> Zipper [] () a Open a zipper from a value.
Totality: total
Visibility: exportfocus : IndexedLens' i (Zipper hs i a) a A lens that points to the current focus of the zipper.
Totality: total
Visibility: exportupward : Zipper ((j @> s) :: hs) i a -> Zipper hs j s Move up a layer of the zipper.
Totality: total
Visibility: exporttug : (a -> Maybe a) -> 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: exportrightward : Alternative f => Zipper hs i a -> f (Zipper hs i a) Move right one value in the current layer. This will fail if already at the
rightmost value.
Totality: total
Visibility: exportleftward : Alternative f => Zipper hs i a -> f (Zipper hs i a) Move left one value in the current layer. This will fail if already at the
leftmost value.
Totality: total
Visibility: exportrightmost : Zipper hs i a -> Zipper hs i a Move to the rightmost value in the current layer.
Totality: total
Visibility: exportleftmost : Zipper hs i a -> Zipper hs i a Move to the leftmost value in the current layer.
Totality: total
Visibility: exportidownward : IndexedLens' i s a -> Zipper hs j s -> Zipper ((j @> s) :: hs) i a Move downward through an indexed lens.
This cannot fail, since a lens always contains a value.
Totality: total
Visibility: exportdownward : Lens' s a -> Zipper hs j s -> Zipper ((j @> s) :: hs) () a Move downward through a lens.
This cannot fail, since a lens always contains a value.
Totality: total
Visibility: exportiwithin : Alternative f => IndexedTraversal' i s a -> Zipper hs j s -> f (Zipper ((j @> s) :: hs) i a) 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: exportwithin : Alternative f => Traversal' s a -> Zipper hs j s -> f (Zipper ((j @> s) :: hs) Nat a) 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: exportrezip : Zipper hs i a -> getTy (last ((i @> a) :: hs)) Close a zipper, repackaging it back into a value of its original type.
Totality: total
Visibility: export