From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q1LIH2kZ018196 for ; Tue, 21 Feb 2012 19:17:03 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvABAJLeQ09KfVI0imdsb2JhbABDhluiUgGJDQgiAQEBCgkNBxIGI4FqBR0CLAEbHgMSCAEHXQERAQUBIi4HhSaCLZg4gl0Ki3KCcYU9P4hzAgULjEUFAQwDAoQNg0sEiE+MaYcXhxY9hCE X-IronPort-AV: E=Sophos;i="4.73,458,1325458800"; d="scan'208";a="132330570" Received: from mail-ww0-f52.google.com ([74.125.82.52]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-MD5; 21 Feb 2012 19:17:03 +0100 Received: by wgbds10 with SMTP id ds10so6397535wgb.9 for ; Tue, 21 Feb 2012 10:17:03 -0800 (PST) Received-SPF: pass (google.com: domain of agarwal1975@gmail.com designates 10.180.24.202 as permitted sender) client-ip=10.180.24.202; Authentication-Results: mr.google.com; spf=pass (google.com: domain of agarwal1975@gmail.com designates 10.180.24.202 as permitted sender) smtp.mail=agarwal1975@gmail.com; dkim=pass header.i=agarwal1975@gmail.com Received: from mr.google.com ([10.180.24.202]) by 10.180.24.202 with SMTP id w10mr27922562wif.9.1329848223321 (num_hops = 1); Tue, 21 Feb 2012 10:17:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; bh=yTAQttSbGlmwvrZEfM4qs96PfyySA05XQhMbP9l4itk=; b=hOoNR38bU79tyCRHMgPVU2CJ+Kk/CDNQXWyCGlPjNn548fRatjdomH0jEF+CN+QN8s uEYki5mO3AWECl0fBlSMFN0dKBimdgme+JxsM32ieS/fcRjeGVb+i+fIZyNOOeasUquT 66SA5ivsQ+UJAna5ALNTsQpgbQN5OQk9NOFFY= Received: by 10.180.24.202 with SMTP id w10mr23255313wif.9.1329848223253; Tue, 21 Feb 2012 10:17:03 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.39.148 with HTTP; Tue, 21 Feb 2012 10:16:43 -0800 (PST) From: Ashish Agarwal Date: Tue, 21 Feb 2012 13:16:43 -0500 Message-ID: To: Caml List Content-Type: multipart/alternative; boundary=f46d04182598f3c46604b97d6a80 Subject: [Caml-list] "module type of" on sub-module of functor result --f46d04182598f3c46604b97d6a80 Content-Type: text/plain; charset=ISO-8859-1 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? --f46d04182598f3c46604b97d6a80 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
The following code compiles correctly:

----- = a.ml -----
open Batteries
m= odule Ord =3D struct type t=3Dstring let compare=3Dcompare end=A0

module type S =3D sig
=A0 include module type of Map.Make(Or= d)
=A0 (* include module type of Map.Make(Ord).Labels *)
end
-----

An easy workaround is to nam= e the functor's result:

----- a.ml -----
=
open Batteries
module Ord =3D struct type t=3Dstring let com= pare=3Dcompare end=A0

module M =3D Map.Make(Ord)

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

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

--f46d04182598f3c46604b97d6a80--