package oxbow
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=a637acaa0e19046cd65fff733874eb97
sha512=76230cbecd7510de7a05b5d1f335915ef7b6c4aa557d8dbfd23591606618d2cfa25082d17b93f2f4b53a118d1cbf6a80e4ad51cf0f099b4921fb83d6df0c9801
doc/oxbow.core/Oxbow_core/Ring/index.html
Module Oxbow_core.RingSource
move_to_top x xs is xs with x at the head and every prior occurrence (by ==) removed.
wrapped_search p l lst is the first element of lst satisfying p; when lst is exhausted, the search continues once through l (the caller's wrap-around list). None when both passes fail.
next_or_first e lst is the element after e (by ==), wrapping from the tail to the head; None when e is not in lst.
prev_or_last e lst is the element before e (by ==), wrapping from the head to the tail; None when e is not in lst.
shift_right p l swaps the first element satisfying p with its successor; the last element wraps to the head. l unchanged when nothing satisfies p.
shift_left p l swaps the first element satisfying p with its predecessor; the head element wraps to the tail. l unchanged when nothing satisfies p.
hop_right sel vis l moves the first element satisfying sel one slot right among the elements satisfying vis: it is removed and reinserted just after its nearest vis-satisfying successor; the last such element wraps to just before the first vis-satisfying element. Elements not satisfying vis keep their relative order to everything else. l unchanged when nothing satisfies sel or no other element satisfies vis.
hop_left sel vis l is the mirror of hop_right: reinserted just before the nearest vis-satisfying predecessor; the first such element wraps to just after the last.
rearrange vis order l is l with the elements that satisfy vis replaced, slot by slot, by the elements of order. The other elements keep their positions. order holds exactly the vis-satisfying elements of l, in any order.
insert_relative ~after ~point ~e l is l with the element e inserted relative to the member point in l. When after is true, e comes after point. When after is false, e is inserted before point. If point is not a member of l, e is inserted at the end. If e is a member of l, it is removed and reinserted accordingly.