From 3ae7c7ca0b49284e63e61ae80f73f5071538dbf2 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Fri, 23 May 2014 00:13:36 +0200 Subject: [PATCH] CCString.equal,compare,hash --- string/CCString.ml | 6 ++++++ string/CCString.mli | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/string/CCString.ml b/string/CCString.ml index e21225a1..a34614cf 100644 --- a/string/CCString.ml +++ b/string/CCString.ml @@ -28,6 +28,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. type t = string +let equal a b = a=b + +let compare = String.compare + +let hash s = Hashtbl.hash s + type 'a gen = unit -> 'a option type 'a sequence = ('a -> unit) -> unit diff --git a/string/CCString.mli b/string/CCString.mli index a3938e1b..50ba1bcf 100644 --- a/string/CCString.mli +++ b/string/CCString.mli @@ -29,6 +29,12 @@ Consider using KMP instead. *) type t = string +val equal : t -> t -> bool + +val compare : t -> t -> int + +val hash : t -> int + type 'a gen = unit -> 'a option type 'a sequence = ('a -> unit) -> unit