protocol
zipperp¶
Zipper protocol.
staticPublic predicates¶
zip/2¶
Adds a zipper to a compound term holding a sequence of elements. Fails if the sequence is empty.
staticzip(Sequence,Zipper)zip(+sequence,--zipper) - zero_or_onezip/3¶
Adds a zipper to a compound term holding a sequence of elements. Also returns the first element. Fails if the sequence is empty.
staticzip(Sequence,Zipper,First)zip(+sequence,--zipper,--term) - zero_or_oneunzip/2¶
Removes a zipper from a sequence.
staticunzip(Zipper,Sequence)unzip(@zipper,--sequence) - onecurrent/2¶
Current element.
staticcurrent(Zipper,Current)current(+zipper,?term) - zero_or_onenext/2¶
Moves to the next element. Fails if already at the last elements.
staticnext(Zipper,NewZipper)next(+zipper,--zipper) - zero_or_onenext/3¶
Moves to and returns the next element. Fails if already at the last elements.
staticnext(Zipper,NewZipper,Next)next(+zipper,--zipper,-term) - zero_or_oneprevious/2¶
Moves to the previous element. Fails if already at the first elements.
staticprevious(Zipper,NewZipper)previous(+zipper,--zipper) - zero_or_oneprevious/3¶
Moves to and returns the previous element. Fails if already at the first element.
staticprevious(Zipper,NewZipper,Previous)previous(+zipper,--zipper,-term) - zero_or_onerewind/2¶
Rewinds the zipper so that the first element becomes the current element.
staticrewind(Zipper,NewZipper)rewind(+zipper,--zipper) - onerewind/3¶
Rewinds the zipper so that the first element becomes the current element. Also returns the first element.
staticrewind(Zipper,NewZipper,First)rewind(+zipper,--zipper,?term) - zero_or_oneforward/2¶
Forward the zipper so that the last element becomes the current element.
staticforward(Zipper,NewZipper)forward(+zipper,--zipper) - oneforward/3¶
Forward the zipper so that the last element becomes the current element. Also returns the last element.
staticforward(Zipper,NewZipper,Last)forward(+zipper,--zipper,?term) - zero_or_oneapply/2¶
Applies a closure to the current element.
staticapply(Closure,Zipper)apply(1,*)apply(+callable,+zipper) - zero_or_moreinsert_before/3¶
Inserts an element before the current one.
staticinsert_before(Zipper,Element,NewZipper)insert_before(+zipper,?term,--zipper) - zero_or_oneinsert_after/3¶
Inserts an element after the current one.
staticinsert_after(Zipper,Element,NewZipper)insert_after(+zipper,?term,--zipper) - zero_or_onereplace/3¶
Replaces the current element with a new element.
staticreplace(Zipper,NewCurrent,NewZipper)replace(+zipper,?term,--zipper) - onedelete_and_previous/2¶
Deletes the current element and moves to the previous element. Fails if no previous element exists.
staticdelete_and_previous(Zipper,NewZipper)delete_and_previous(+zipper,--zipper) - zero_or_onedelete_and_next/2¶
Deletes the current element and moves to the next element. Fails if no next element exists.
staticdelete_and_next(Zipper,NewZipper)delete_and_next(+zipper,--zipper) - zero_or_onedelete_and_unzip/2¶
Deletes the current element and removes the zipper returning the resulting sequence.
staticdelete_and_unzip(Zipper,Sequence)delete_and_unzip(+zipper,--sequence) - onedelete_all_before/2¶
Deletes all elements before the current element.
staticdelete_all_before(Zipper,NewZipper)delete_all_before(+zipper,--zipper) - onedelete_all_before_and_unzip/2¶
Deletes all elements before the current element and removes the zipper returning the resulting sequence.
staticdelete_all_before_and_unzip(Zipper,NewZipper)delete_all_before_and_unzip(+zipper,--sequence) - onedelete_all_after/2¶
Deletes all elements after the current element.
staticdelete_all_after(Zipper,NewZipper)delete_all_after(+zipper,--zipper) - onedelete_all_after_and_unzip/2¶
Deletes all elements after the current element and removes the zipper returning the resulting sequence.
staticdelete_all_after_and_unzip(Zipper,NewZipper)delete_all_after_and_unzip(+zipper,--sequence) - oneProtected predicates¶
(none)
Private predicates¶
(none)