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 q1LKX1N8024095 for ; Tue, 21 Feb 2012 21:33:01 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ar4CADn+Q0/QYYRKkGdsb2JhbABDhROtKCoBAQEBCQkNBxQDJIFzAQEBBBICDx0DATUBAQ4LCw0CAiYCAiEBEgEFARwGExsHokwKijltg0OObAEGgS+HTViCWwYFBAIEBgIEDwMDAoNfAiwCHIIXgRaIU4xpixeDFj2EIYE1CQ X-IronPort-AV: E=Sophos;i="4.73,459,1325458800"; d="scan'208";a="132343531" Received: from caiajhbdcahe.dreamhost.com (HELO homiemail-a95.g.dreamhost.com) ([208.97.132.74]) by mail4-smtp-sop.national.inria.fr with ESMTP; 21 Feb 2012 21:32:55 +0100 Received: from homiemail-a95.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a95.g.dreamhost.com (Postfix) with ESMTP id D94F81E078 for ; Tue, 21 Feb 2012 12:32:53 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=0ok.org; h=mime-version :in-reply-to:references:from:date:message-id:subject:to:cc: content-type; q=dns; s=0ok.org; b=lJg7oDr4NPs3rfhEfjpc9Nj5aJ4jNC TojU/ElE+AWJLs0HRqc5aC7cM7cXaQanlp01ncSWS7mo0Ec/iJXb1PxuQP5eCAHj 8vIuPBUSdnZuHkFhqk2YHgWQp3nBoMmEY2QCYYKbNQq3AXOavhFPt1EOuSqJuDhS lBofq2oulmVN4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=0ok.org; h=mime-version :in-reply-to:references:from:date:message-id:subject:to:cc: content-type; s=0ok.org; bh=n0p1mfcSJC+dMzzkHrjcnTXZ4uo=; b=BTmh YWSk/PIJkqGH16TnCDvZwhim8cW72qd1LjLxLOjHoyBMJF5kEALtS+rHUigQnpFl uDrCVgg2Q4/xKMnO/2NbwoqGCgs6Wm1/h6uTbQVlr3d258kPU9Vha+v8WKVpY8ep DUEZWyqp3oQstTLLGKpx1HLyHbuh0s5cG2ZJ+nw= Received: from mail-tul01m020-f182.google.com (mail-tul01m020-f182.google.com [209.85.214.182]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: hez@0ok.org) by homiemail-a95.g.dreamhost.com (Postfix) with ESMTPSA id B704B1E076 for ; Tue, 21 Feb 2012 12:32:53 -0800 (PST) Received: by obcwo16 with SMTP id wo16so15616710obc.27 for ; Tue, 21 Feb 2012 12:32:53 -0800 (PST) Received-SPF: pass (google.com: domain of hez@0ok.org designates 10.60.3.72 as permitted sender) client-ip=10.60.3.72; Authentication-Results: mr.google.com; spf=pass (google.com: domain of hez@0ok.org designates 10.60.3.72 as permitted sender) smtp.mail=hez@0ok.org Received: from mr.google.com ([10.60.3.72]) by 10.60.3.72 with SMTP id a8mr13399184oea.19.1329856373185 (num_hops = 1); Tue, 21 Feb 2012 12:32:53 -0800 (PST) Received: by 10.60.3.72 with SMTP id a8mr11483042oea.19.1329856373124; Tue, 21 Feb 2012 12:32:53 -0800 (PST) MIME-Version: 1.0 Received: by 10.60.44.228 with HTTP; Tue, 21 Feb 2012 12:32:33 -0800 (PST) In-Reply-To: References: From: "Hezekiah M. Carty" Date: Tue, 21 Feb 2012 15:32:33 -0500 Message-ID: To: Ashish Agarwal Cc: Caml List Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQk5m6SefPYd48Ggac0Wqa3nqgvDGA5BcAee9wn1i/tCdt1C2bbrfeFdTT+VBYy8Hf2FbPTV Subject: Re: [Caml-list] Re: "module type of" on sub-module of functor result On Tue, Feb 21, 2012 at 2:37 PM, Ashish Agarwal wrote: > 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. > I use this quite often. Your first example is close: ---- 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) (* You do not need the Map.Make(Ord) prefix *) include module type of Labels end ---- That works for me on OCaml 3.12.1 with Batteries 1.4.1. Hez