Below is the file 'q.mli' from this revision. You can also download the file.

(** Simple functional queues *)

type +'a t

val empty : 'a t

val push      : 'a t -> 'a -> 'a t
val pop       : 'a t -> ('a * 'a t) option
val push_list : 'a t -> 'a list -> 'a t
val concat    : 'a t -> 'a t -> 'a t
val to_list   : 'a t -> 'a list
val of_list   : 'a list -> 'a t

val list_fold : ('a t -> 'b -> 'a t) -> 'b list -> 'a list