Add a generic deque module.
[tatoo.git] / src / deque.mli
diff --git a/src/deque.mli b/src/deque.mli
new file mode 100644 (file)
index 0000000..fecf60c
--- /dev/null
@@ -0,0 +1,37 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                               TAToo                                 *)
+(*                                                                     *)
+(*                     Kim Nguyen, LRI UMR8623                         *)
+(*                   Université Paris-Sud & CNRS                       *)
+(*                                                                     *)
+(*  Copyright 2010-2013 Université Paris-Sud and Centre National de la *)
+(*  Recherche Scientifique. All rights reserved.  This file is         *)
+(*  distributed under the terms of the GNU Lesser General Public       *)
+(*  License, with the special exception on linking described in file   *)
+(*  ../LICENSE.                                                        *)
+(*                                                                     *)
+(***********************************************************************)
+
+module type S =
+  sig
+    type elem
+    type t
+    type iterator
+
+    val create : unit -> t
+    val add : elem -> t -> unit
+    val push_front : elem -> t -> unit
+    val push_back : elem -> t -> unit
+    val iter : (elem -> unit) -> t -> unit
+    val length : t -> int
+    val is_empty : t -> bool
+    val head : t -> iterator
+    val last : t -> iterator
+    val next : iterator -> iterator
+    val value : iterator -> elem
+    val finished : iterator -> bool
+    val copy : t -> t
+  end
+
+module Make (E : sig type t end) : S with type elem = E.t