From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id oBNFYEnm009477 for ; Thu, 23 Dec 2010 16:34:14 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: As8AAD/6Ek3RVdivkGdsb2JhbACWD44RCBYBAgkJDAcRBCCnDYl3ghiFCC6IVwEBAwWFRQSLBA X-IronPort-AV: E=Sophos;i="4.60,219,1291590000"; d="scan'208";a="84638504" Received: from mail-qy0-f175.google.com ([209.85.216.175]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-MD5; 23 Dec 2010 16:34:08 +0100 Received: by qyk8 with SMTP id 8so6957443qyk.6 for ; Thu, 23 Dec 2010 07:34:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type; bh=hqEbQ+PdL7iGf9LEhKuVTfVZb+EsUVota8IAGj9D7bU=; b=fFDlMrJp3gReHz9HS4+TbM3pAK9khVw7tMl6W6rnfoKCjhUaTjAUb7kUR0yDy2QVJk U8Swzbp6yUmC9OuDbSrCL+Jd4LbpsWN9LTggShJISKkO/DQcStFlgfkcjPHEnfHMftO5 4QYWEQZJ0ToRuHMk51vEhdN/o6/0HEc3DK4Ec= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=SnNqGCZX5aSIhoGTQDnRuvvW9OV8PFBt9+pKNs7hHAxk9M+GkINdI52utxNN7JBetP RVUKxqx64ASCDevKAPXpUJ/wiQJssq1/Wo+4YD31YoqQJgcPkBH/k5sjj8QM0koai60C juyPP/3STyDu5RJhoXZTEHvd1rR6UJxd3+GVc= Received: by 10.229.241.78 with SMTP id ld14mr7317138qcb.121.1293118447697; Thu, 23 Dec 2010 07:34:07 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.86.200 with HTTP; Thu, 23 Dec 2010 07:33:47 -0800 (PST) In-Reply-To: <20101217091950.GA28557@melkinpaasi.cs.helsinki.fi> References: <20101217091950.GA28557@melkinpaasi.cs.helsinki.fi> From: Lukasz Stafiniak Date: Thu, 23 Dec 2010 16:33:47 +0100 Message-ID: To: caml-list@inria.fr Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Caml-list] Unimplemented modules as top-level signatures Interesting question. Lack of response on the mailing list means agreement that this is an OK style? On Fri, Dec 17, 2010 at 10:19 AM, Lauri Alanko wrote: > A minor annoyance in OCaml is that although you can (and must) put > each top-level module into its own file, there is no corresponding > mechanism for defining module types on their own: you always have to > put a "module type" definition inside another module, which > complicates scoping, and with standard tools adds an extra level of > indentation to the signature definition. > > However, with 3.12 there is solution of sorts: write the signature > definition in foo.mli without an accompanying foo.ml, and then refer > to the signature as "module type of Foo". > > Is this horrible style? Are there some pitfalls I should be aware of? > Or are there better solutions to my desire to avoid nested scoping? > Top-level functors would also be nice to have... :)