English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
How to use Set Datatype
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-12-11 (01:30)
From: Jon Harrop <jon@j...>
Subject: Re: [Caml-list] How to use Set Datatype
On Friday 10 December 2004 19:44, Micha wrote:
> module StringSet = Set.Make (struct type t = string   let compare = compare
>  end);;

As the "String" module implements both a type "t" and a "compare" function, 
you can just write:

# module StringSet = Set.Make(String);;
...

Cheers,
Jon.