module Dllist: sig end
This data structure is not thread safe.
See also testing/test_dllist.ml for simple examples of how to use this
module.
exception Empty
exception OutOfBounds
type 'a t
'a.type 'a cons
'a.val deref : 'a cons -> 'aval create : unit -> 'a tval first : 'a t -> 'a consfirst d returns the first cell in the dllist d. Raise Empty
if the dllist is empty.val last : 'a t -> 'a conslast d returns the last cell in the dllist d. Raise Empty if
the dllist is empty.val next : 'a cons -> 'a consnext c returns the next cell in the dllist in which c is
contained. Returns OutOfBounds if c is the last cell.val prev : 'a cons -> 'a consprev c returns the previous cell in the dllist in which c is
contained. Returns OutOfBounds if c is the first cell.val insert_end : 'a -> 'a t -> 'a consinsert_end v q inserts a new cell with value v at the end of
the dllist q, and returns the newly created cell.val insert_before : 'a -> 'a cons -> 'a consinsert_before v c inserts a new cell with value v just before
cell c in the dllist in which c exists, and returns the newly
created cell.exception Cons_already_free
val remove : 'a cons -> unitremove c removes the cell c from dllist where it exists.val count : 'a t -> intcount q returns the number of cells in the dllist q.val to_list : 'a t -> 'a cons listval iter : ('a -> unit) -> 'a t -> unititer f q applies f e for each entry e of the dllist
q.