module type S = sig end
The signature of skiplists for a given key type
type key
The key type
type 'a
t
The type of skiplists
val create : ?size:int -> unit -> 'a t
Create a new skiplist with given max height, or 5 if none is given.
val clear : 'a t -> unit
Wipe out the skiplist
val size : 'a t -> int
The number of elements in the skiplist
val add : 'a t -> key:key -> data:'a -> unit
Insert an element
val find : 'a t -> key -> 'a
Look up an element
val remove : 'a t -> key -> unit
Remove an element
val mem : 'a t -> key -> bool
Like List.mem
val iter : 'a t -> f:(key -> 'a -> unit) -> unit
Like Map.iter
val fold : 'a t -> f:(key -> 'a -> 'b -> 'b) -> init:'b -> 'b
Like Map.fold