package containers
Install
Dune Dependency
Authors
Maintainers
Sources
md5=03b80e963186e91ddac62ef645bf7fb2
sha512=c8f434808be540c16926bf03d89f394d33fc2d092f963a7b6d412481229e0a96290f1ad7c7d522415115d35426b7aa0b3fda4b991ddc321dad279d402c9a0c0b
doc/containers.data/CCZipper/index.html
Module CCZipper
Source
List Zipper
The pair l, r
represents the list List.rev_append l r
, but with the focus on r
Convert the zipper back to a list. to_list (l,r)
is List.rev_append l r
.
Convert the zipper back to a reversed list. In other words, to_list (l,r)
is List.rev_append r l
.
Go to the left, or do nothing if the zipper is already at leftmost pos.
Go to the right, or do nothing if the zipper is already at rightmost pos.
Modify the current element, if any, by returning a new element, or returning None
if the element is to be deleted.
Insert an element at the current position. If an element was focused, insert x l
adds x
just before it, and focuses on x
.
Is the zipper focused on some element? That is, will focused
return a Some v
?
Return the focused element, if any. focused zip = Some _
iff empty zip = false
.
Drop every element on the "left" (calling left
then will do nothing).
Drop every element on the "right" (calling right
then will do nothing), keeping the focused element, if any.