Version française
Home     About     Download     Resources     Contact us    
Browse thread
RE: [Caml-list] Basic question about modules
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Tim Docker <timothy.docker@m...>
Subject: RE: [Caml-list] Basic question about modules
> Well, you can use `ocamlc -i' to initially create the .mli file,
> or inspect its output for help.

Thanks - this is good. Looking at the output, I see that the entire
signature for the string map is present:

 | module StringMap :
 |   sig
 |     type key = String.t
 |     and 'a t = 'a Map.Make(String).t
 |     val empty : 'a t
 |     val add : key -> 'a -> 'a t -> 'a t
 |     val find : key -> 'a t -> 'a
 |     val remove : key -> 'a t -> 'a t
 |     val mem : key -> 'a t -> bool
 |     val iter : (key -> 'a -> unit) -> 'a t -> unit
 |     val map : ('a -> 'b) -> 'a t -> 'b t
 |     val mapi : (key -> 'a -> 'b) -> 'a t -> 'b t
 |     val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
 |   end
 | type info = int list StringMap.t
 | and named_values = { details : info; }

Do I actually have to duplicate the above signature for the StringMap
as shown above in my own mli file (and other similar types).
This seems pretty heavy handed.

At the end of the day I am just attempting to define some datatypes
that include maps of various types created with the Map.Make functor.

Thanks,

Tim