Module Range

Skewed lists

This is a purely functional datastructure isomorphic to usual lists, except that it features a O(log n) lookup while preserving the O(1) cons operation.

Constructors
type +'a t
val empty : 'a t
val cons : 'a -> 'a t -> 'a t
List operations
val is_empty : 'a t -> bool
val length : 'a t -> int
val map : ('a -> 'b) -> 'a t -> 'b t
val fold_left : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'a
val fold_right : ('a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val hd : 'a t -> 'a
val tl : 'a t -> 'a t
val skipn : int -> 'a t -> 'a t
Indexing operations
val get : 'a t -> int -> 'a