caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] "module type of" on sub-module of functor result
@ 2012-02-21 18:16 Ashish Agarwal
  2012-02-21 19:37 ` [Caml-list] " Ashish Agarwal
  0 siblings, 1 reply; 12+ messages in thread
From: Ashish Agarwal @ 2012-02-21 18:16 UTC (permalink / raw)
  To: Caml List

[-- Attachment #1: Type: text/plain, Size: 581 bytes --]

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?

[-- Attachment #2: Type: text/html, Size: 981 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-02-23 14:30 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-21 18:16 [Caml-list] "module type of" on sub-module of functor result Ashish Agarwal
2012-02-21 19:37 ` [Caml-list] " Ashish Agarwal
2012-02-21 20:32   ` Hezekiah M. Carty
2012-02-22 16:18     ` Milan Stanojević
2012-02-22 16:40       ` Till Varoquaux
2012-02-22 17:24         ` Gabriel Scherer
2012-02-22 18:49           ` Andreas Rossberg
2012-02-22 23:17             ` Jacques Garrigue
2012-02-23 10:05               ` Gabriel Scherer
2012-02-23 14:30                 ` Ashish Agarwal
2012-02-22 17:35         ` Ashish Agarwal
2012-02-22 17:48           ` Gabriel Scherer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).