module Index:Functions that operate on thesig
..end
i
th element of a list.
While it is sometimes necessary to perform these
operations on lists (hence their inclusion here), the
functions were moved to an inner module to prevent
their overuse: all functions work in O(n) time. You
might prefer to use Array
or DynArray
for constant
time indexed element access.
val index_of : 'a RefList.t -> 'a -> int
Not_found
if no element was foundval index : ('a -> bool) -> 'a RefList.t -> int
Not_found
if no element was foundval at_index : 'a RefList.t -> int -> 'a
Invalid_index
if the index is outside 0 ; length-1
val set : 'a RefList.t -> int -> 'a -> unit
Invalid_index
if the index is outside 0 ; length-1
val remove_at : 'a RefList.t -> int -> unit
Invalid_index
if the index is outside 0 ; length-1