12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879moduletypeOps=sigtype'attype'anodetype('x,'fn)fnvalremove:('x,'anode->unit)fn(** [remove n] removes the node [n] from the doubly-linked list it is part of.
[remove] is idempotent. *)valis_empty:('x,'at->bool)fn(** [is_empty l] determines whether the doubly-linked list [l] is empty or
not. *)valadd_l:('x,'a->'at->'anode)fn(** [add_l v l] creates and returns a new node with the value [v] and adds the
node to the left of the doubly-linked list [l]. *)valadd_r:('x,'a->'at->'anode)fn(** [add_r v l] creates and returns a new node with the value [v] and adds the
node to the right of the doubly-linked list [l]. *)valtake_opt_l:('x,'at->'aoption)fn(** [take_opt_l l] removes and returns the value of leftmost node of the
doubly-linked list [l], or return [None] if the list is empty. *)valtake_opt_r:('x,'at->'aoption)fn(** [take_opt_r l] removes and returns the value of rightmost node of the
doubly-linked list [l], or return [None] if the list is empty. *)valtake_blocking_l:('x,'at->'a)fn(** [take_blocking_l l] removes and returns the value of leftmost node of the
doubly-linked list [l], or blocks waiting for the list to become
non-empty. *)valtake_blocking_r:('x,'at->'a)fn(** [take_blocking_r l] removes and returns the value of rightmost node of the
doubly-linked list [l], or blocks waiting for the list to become
non-empty. *)valswap:('x,'at->'at->unit)fn(** [swap l1 l2] exchanges the nodes of the doubly-linked lists [l1] and
[l2]. *)valtransfer_l:('x,'at->'at->unit)fn(** [transfer_l l1 l2] removes all nodes of [l1] and adds them to the left of
[l2]. *)valtransfer_r:('x,'at->'at->unit)fn(** [transfer_r l1 l2] removes all nodes of [l1] and adds them to the right of
[l2]. *)valto_list_l:('x,'at->'alist)fn(** [to_list_l l] collects the values of the nodes of the doubly-linked list
[l] to a list in left-to-right order.
{b NOTE}: This operation is linear time, [O(n)], and should typically be
avoided unless the list is privatized, e.g. by using {!take_all}. *)valto_list_r:('x,'at->'alist)fn(** [to_list_r l] collects the values of the nodes of the doubly-linked list
[l] to a list in right-to-left order.
{b NOTE}: This operation is linear time, [O(n)], and should typically be
avoided unless the list is privatized, e.g. by using {!take_all}. *)valto_nodes_l:('x,'at->'anodelist)fn(** [to_nodes_l l] collects the nodes of the doubly-linked list [l] to a list
in left-to-right order.
{b NOTE}: This operation is linear time, [O(n)], and should typically be
avoided unless the list is privatized, e.g. by using {!take_all}. *)valto_nodes_r:('x,'at->'anodelist)fn(** [to_nodes_r l] collects the nodes of the doubly-linked list [l] to a list
in right-to-left order.
{b NOTE}: This operation is linear time, [O(n)], and should typically be
avoided unless the list is privatized, e.g. by using {!take_all}. *)end