Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I declare a module (actually a Set.Make) in mli file?

Tags:

ocaml

I have airport.mli and airport.ml.


In airport.ml, I have

module AirportSet = Set.Make(struct type t = airport let compare = compare end);;

This is no problem.


I then have a function

val get_all_airport : unit -> AirportSet.t;;

, which generates a AirportSet.


so in airport.mli, I need to show the module AirportSet so AirportSet is recognized.

How can I do that?

like image 475
Jackson Tale Avatar asked May 14 '13 16:05

Jackson Tale


1 Answers

module AirportSet : (Set.S with type elt = airport)

(The parens are actually unnecessary, putting them there so that you know this is a signature expected, in the general case of the form sig ... end).

like image 64
gasche Avatar answered Oct 24 '22 11:10

gasche