diff options
| author | Maxime Dénès | 2018-01-22 09:33:21 +0100 |
|---|---|---|
| committer | Maxime Dénès | 2018-01-22 09:33:21 +0100 |
| commit | 314928aa0a430447a2fab30b9ef1235afa77c054 (patch) | |
| tree | b0de77473ca078c9a49cff9ef19589c07de0e578 /clib/range.mli | |
| parent | 9aa2464375c1515aa64df7dc910e2f324e34c82f (diff) | |
| parent | 045193aedfd6a262981f06c500af1cc13df2900f (diff) | |
Merge PR #6506: Fast rel lookup
Diffstat (limited to 'clib/range.mli')
| -rw-r--r-- | clib/range.mli | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/clib/range.mli b/clib/range.mli new file mode 100644 index 0000000000..ae7684ffa5 --- /dev/null +++ b/clib/range.mli @@ -0,0 +1,37 @@ +(************************************************************************) +(* v * The Coq Proof Assistant / The Coq Development Team *) +(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *) +(* \VV/ **************************************************************) +(* // * This file is distributed under the terms of the *) +(* * GNU Lesser General Public License Version 2.1 *) +(************************************************************************) + +(** 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. + +*) + +(** {5 Constructors} *) + +type +'a t + +val empty : 'a t +val cons : 'a -> 'a t -> 'a t + +(** {5 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 + +(** {5 Indexing operations} *) + +val get : 'a t -> int -> 'a |
