protocol
zipperp
Zipper protocol.
logtalk_load(zippers(loader))
static
Public predicates
zip/2
Adds a zipper to a compound term holding a sequence of elements. Fails if the sequence is empty.
static
zip(Sequence,Zipper)
zip(+sequence,--zipper)
- zero_or_one
zip/3
Adds a zipper to a compound term holding a sequence of elements. Also returns the first element. Fails if the sequence is empty.
static
zip(Sequence,Zipper,First)
zip(+sequence,--zipper,--term)
- zero_or_one
unzip/2
Removes a zipper from a sequence.
static
unzip(Zipper,Sequence)
unzip(@zipper,--sequence)
- one
current/2
Current element.
static
current(Zipper,Current)
current(+zipper,?term)
- zero_or_one
next/2
Moves to the next element. Fails if already at the last elements.
static
next(Zipper,NewZipper)
next(+zipper,--zipper)
- zero_or_one
next/3
Moves to and returns the next element. Fails if already at the last elements.
static
next(Zipper,NewZipper,Next)
next(+zipper,--zipper,-term)
- zero_or_one
previous/2
Moves to the previous element. Fails if already at the first elements.
static
previous(Zipper,NewZipper)
previous(+zipper,--zipper)
- zero_or_one
previous/3
Moves to and returns the previous element. Fails if already at the first element.
static
previous(Zipper,NewZipper,Previous)
previous(+zipper,--zipper,-term)
- zero_or_one
rewind/2
Rewinds the zipper so that the first element becomes the current element.
static
rewind(Zipper,NewZipper)
rewind(+zipper,--zipper)
- one
rewind/3
Rewinds the zipper so that the first element becomes the current element. Also returns the first element.
static
rewind(Zipper,NewZipper,First)
rewind(+zipper,--zipper,?term)
- zero_or_one
forward/2
Forward the zipper so that the last element becomes the current element.
static
forward(Zipper,NewZipper)
forward(+zipper,--zipper)
- one
forward/3
Forward the zipper so that the last element becomes the current element. Also returns the last element.
static
forward(Zipper,NewZipper,Last)
forward(+zipper,--zipper,?term)
- zero_or_one
apply/2
Applies a closure to the current element.
static
apply(Closure,Zipper)
apply(1,*)
apply(+callable,+zipper)
- zero_or_more
insert_before/3
Inserts an element before the current one.
static
insert_before(Zipper,Element,NewZipper)
insert_before(+zipper,?term,--zipper)
- zero_or_one
insert_after/3
Inserts an element after the current one.
static
insert_after(Zipper,Element,NewZipper)
insert_after(+zipper,?term,--zipper)
- zero_or_one
replace/3
Replaces the current element with a new element.
static
replace(Zipper,NewCurrent,NewZipper)
replace(+zipper,?term,--zipper)
- one
delete_and_previous/2
Deletes the current element and moves to the previous element. Fails if no previous element exists.
static
delete_and_previous(Zipper,NewZipper)
delete_and_previous(+zipper,--zipper)
- zero_or_one
delete_and_next/2
Deletes the current element and moves to the next element. Fails if no next element exists.
static
delete_and_next(Zipper,NewZipper)
delete_and_next(+zipper,--zipper)
- zero_or_one
delete_and_unzip/2
Deletes the current element and removes the zipper returning the resulting sequence.
static
delete_and_unzip(Zipper,Sequence)
delete_and_unzip(+zipper,--sequence)
- one
delete_all_before/2
Deletes all elements before the current element.
static
delete_all_before(Zipper,NewZipper)
delete_all_before(+zipper,--zipper)
- one
delete_all_before_and_unzip/2
Deletes all elements before the current element and removes the zipper returning the resulting sequence.
static
delete_all_before_and_unzip(Zipper,NewZipper)
delete_all_before_and_unzip(+zipper,--sequence)
- one
delete_all_after/2
Deletes all elements after the current element.
static
delete_all_after(Zipper,NewZipper)
delete_all_after(+zipper,--zipper)
- one
delete_all_after_and_unzip/2
Deletes all elements after the current element and removes the zipper returning the resulting sequence.
static
delete_all_after_and_unzip(Zipper,NewZipper)
delete_all_after_and_unzip(+zipper,--sequence)
- one
Protected predicates
(none)
Private predicates
(none)
Operators
(none)
See also