| 1 | (************************************************************************) |
| 2 | (* * The Rocq Prover / The Rocq Development Team *) |
| 3 | (* v * Copyright INRIA, CNRS and contributors *) |
| 4 | (* <O___,, * (see version control and CREDITS file for authors & dates) *) |
| 5 | (* \VV/ **************************************************************) |
| 6 | (* // * This file is distributed under the terms of the *) |
| 7 | (* * GNU Lesser General Public License Version 2.1 *) |
| 8 | (* * (see LICENSE file for the text of the license) *) |
| 9 | (************************************************************************) |
| 10 | |
| 11 | (** Skewed lists |
| 12 | |
| 13 | This is a purely functional datastructure isomorphic to usual lists, except |
| 14 | that it features a O(log n) lookup while preserving the O(1) cons operation. |
| 15 | |
| 16 | *) |
| 17 | |
| 18 | (** {5 Constructors} *) |
| 19 | |
| 20 | type +'a t |
| 21 | |
| 22 | val empty : 'a t |
| 23 | val cons : 'a -> 'a t -> 'a t |
| 24 | |
| 25 | (** {5 List operations} *) |
| 26 | |
| 27 | val is_empty : 'a t -> bool |
| 28 | val length : 'a t -> int |
| 29 | val map : ('a -> 'b) -> 'a t -> 'b t |
| 30 | val fold_left : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'a |
| 31 | val fold_right : ('a -> 'b -> 'b) -> 'a t -> 'b -> 'b |
| 32 | val hd : 'a t -> 'a |
| 33 | val tl : 'a t -> 'a t |
| 34 | |
| 35 | val skipn : int -> 'a t -> 'a t |
| 36 | |
| 37 | (** {5 Indexing operations} *) |
| 38 | |
| 39 | val get : 'a t -> int -> 'a |