module Doubly_linked:doubly-linked listssig..end
module Elt:sig..end
type 'a t
include Container.S1
include Sexpable.S1
val invariant : 'a t -> unitval create : unit -> 'a tval of_list : 'a list -> 'a tof_list l returns a doubly-linked list t with the same elements as l
and in the same order (i.e. the first element of l is the first element
of t). It is always the case that l = to_list (of_list l).val equal : 'a t -> 'a t -> boolval is_first : 'a t -> 'a Elt.t -> boolval is_last : 'a t -> 'a Elt.t -> boolval first_elt : 'a t -> 'a Elt.t optionval last_elt : 'a t -> 'a Elt.t optionval first : 'a t -> 'a optionval last : 'a t -> 'a optionval next : 'a t -> 'a Elt.t -> 'a Elt.t optionval prev : 'a t -> 'a Elt.t -> 'a Elt.t optionval insert_before : 'a t -> 'a Elt.t -> 'a -> 'a Elt.tinsert_before t e a or insert_after t e a if e
is not an element in t, and will break invariants.val insert_after : 'a t -> 'a Elt.t -> 'a -> 'a Elt.tval insert_first : 'a t -> 'a -> 'a Elt.tval insert_last : 'a t -> 'a -> 'a Elt.tval remove : 'a t -> 'a Elt.t -> unitremove t e when e is not in t, and will break
invariant.val remove_first : 'a t -> 'a optionval remove_last : 'a t -> 'a optionval find_elt : 'a t -> f:('a -> bool) -> 'a Elt.t optionfind_elt t ~f finds the first element in t that satisfies f, by
testing each of element of t in turn until f succeeds.val clear : 'a t -> unitclear t removes all elements from the list in constant time.val copy : 'a t -> 'a tcopy t returns a copy of t.val transfer : src:'a t -> dst:'a t -> unittransfer ~src ~dst has the same behavior as
iter src ~f:(insert_last dst); clear src
except that it runs in constant time.
If s = to_list src and d = to_list dst, then after transfer ~src ~dst:
to_list src = []
to_list dst = d @ s
val filter_inplace : 'a t -> f:('a -> bool) -> unitfilter_inplace t ~f removes all elements of t that don't satisfy f.