I must've accidentally deleted part of my email before hitting send. The point was to make the first code sample compile after removing the commented line. But that is not allowed; I get a syntax error:

$ ocamlfind ocamlc -c -package batteries a.ml 
File "a.ml", line 6, characters 38-39:
Error: Syntax error: 'end' expected
File "a.ml", line 4, characters 16-19:
Error: This 'sig' might be unmatched

I'm wondering if there is a better solution than my second code sample.


On Tue, Feb 21, 2012 at 1:16 PM, Ashish Agarwal <agarwal1975@gmail.com> wrote:
The following code compiles correctly:

----- a.ml -----
open Batteries
module Ord = struct type t=string let compare=compare end 

module type S = sig
  include module type of Map.Make(Ord)
  (* include module type of Map.Make(Ord).Labels *)
end
-----

An easy workaround is to name the functor's result:

----- a.ml -----
open Batteries
module Ord = struct type t=string let compare=compare end 

module M = Map.Make(Ord)

module type S = sig
  include module type of M
  include module type of M.Labels
end
-----

The above compiles correctly, but is this the best/only solution?