From 29ff651f3bdbe355aca8625191ac1d978a0743b0 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Tue, 20 May 2014 19:52:17 +0200 Subject: [PATCH] details --- core/CCKList.ml | 5 +++++ core/CCKList.mli | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/core/CCKList.ml b/core/CCKList.ml index f59ea6ad..a9a5fe81 100644 --- a/core/CCKList.ml +++ b/core/CCKList.ml @@ -33,9 +33,14 @@ type + 'a t = let nil = `Nil let cons a b = `Cons (a,b) +let empty = nil let singleton x = `Cons (x, fun () -> `Nil) +let is_empty = function + | `Nil -> true + | `Cons _ -> false + let to_list l = let rec direct i (l:'a t) = match l with | `Nil -> [] diff --git a/core/CCKList.mli b/core/CCKList.mli index cb568e27..ac430092 100644 --- a/core/CCKList.mli +++ b/core/CCKList.mli @@ -32,10 +32,14 @@ type + 'a t = val nil : 'a t +val empty : 'a t + val cons : 'a -> (unit -> 'a t) -> 'a t val singleton : 'a -> 'a t +val is_empty : 'a t -> bool + val of_list : 'a list -> 'a t val to_list : 'a t -> 'a list