From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id 230647EE20 for ; Mon, 19 Nov 2012 13:44:26 +0100 (CET) Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of p.donadeo@gmail.com) identity=pra; client-ip=209.85.214.182; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="p.donadeo@gmail.com"; x-sender="p.donadeo@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail4-smtp-sop.national.inria.fr: domain of p.donadeo@gmail.com designates 209.85.214.182 as permitted sender) identity=mailfrom; client-ip=209.85.214.182; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="p.donadeo@gmail.com"; x-sender="p.donadeo@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ob0-f182.google.com) identity=helo; client-ip=209.85.214.182; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="p.donadeo@gmail.com"; x-sender="postmaster@mail-ob0-f182.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: At0BALkoqlDRVda2k2dsb2JhbABFhiCqBYk3AYlbCCMBAQEBCQkLCRQEI4IeAQEEASMdARsSDAMBCwYFCw0NHQICIgERAQUBChIGExKHaAEDCQYLoRqLZE+CeIQ/ChknAwpZiHUBBQyMKIN6gRMDlXyBHI1GFimEEg X-IronPort-AV: E=Sophos;i="4.83,279,1352070000"; d="scan'208";a="162990765" Received: from mail-ob0-f182.google.com ([209.85.214.182]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 19 Nov 2012 13:44:24 +0100 Received: by mail-ob0-f182.google.com with SMTP id 16so8231895obc.27 for ; Mon, 19 Nov 2012 04:44:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=FF7hoeOa6wsq+UCMRL5G/gE8sa5WcNIBD/9pa3YFWnw=; b=a3lZRDFanEf8RDUTKYR0eyiwGi27dCWEEGtvUAceCrlQciBD74Y07UNDyeCKGa1fw0 OOHRL/GcJmZfdNit/h/PzWxN1NbfVGHUDSwqkzqSVXUEYXAdnqgkZfJYgyIN1L2O1ato eMYZ9FfMNV3yisDb+M5IDiCScHLUgljf8+ylq9d8I4aDi7AVIiVCFIwhLVEtR6iNtob6 gdvp+0QaDjTqWWndCa9XRyx++9jSgJJ2BzMS+mWUpya9BOBuHM9rJJcIpmq/zi1FpRcS B3L5WR5QAgJzm3v0e3Zemz4DZB0cUJwakhgGqMcUKz0vT/z2zOHUW8w0O9mXEjCghbDP x/CQ== MIME-Version: 1.0 Received: by 10.182.172.74 with SMTP id ba10mr10323200obc.83.1353329063484; Mon, 19 Nov 2012 04:44:23 -0800 (PST) Received: by 10.60.170.104 with HTTP; Mon, 19 Nov 2012 04:44:23 -0800 (PST) Received: by 10.60.170.104 with HTTP; Mon, 19 Nov 2012 04:44:23 -0800 (PST) In-Reply-To: References: <50A9C3BB.2050900@riken.jp> <50A9CB66.1020207@ens-lyon.org> <50A9D378.4020403@riken.jp> Date: Mon, 19 Nov 2012 13:44:23 +0100 Message-ID: From: Paolo Donadeo To: OCaml mailing list Content-Type: multipart/alternative; boundary=e89a8f839f6f17dcd404ced87ab0 Subject: Re: [Caml-list] module alias in a .mli file --e89a8f839f6f17dcd404ced87ab0 Content-Type: text/plain; charset=UTF-8 Actually this is not true, Martin explained how. :-) -- Paolo Sent by Gmail from Android Il giorno 19/nov/2012 11:35, "David House" ha scritto: > Annoyingly though, there is no way to create a module alias in an mli. > > If, in an ml file, you have to refer often to > Some_very_long_module_name, it can quite convenient to define an alias > by doing "module Mod = Some_very_long_module_name" (or, locally, "let > module Mod = Some_very_long_module_name in"). But there is no way of > doing this in an mli: you have to use the long name every time. > > This is especially annoying if you have some big type that you want to > expose in the mli. You really just want to copy-paste out of the ml > file and stick it into the mli, but then you have to expand all the > module aliases. (It's just a couple of goes with M-%, but still...) > > On Mon, Nov 19, 2012 at 6:36 AM, Francois Berenger > wrote: > > On 11/19/2012 03:02 PM, Martin Jambon wrote: > >> > >> On Sun 18 Nov 2012 09:29:31 PM PST, Francois Berenger wrote: > >>> > >>> Hello, > >>> > >>> Here is my stupid question of the day: > >>> can't I declare the following in a .mli file? > >>> > >>> module V3 = Vector3 > >> > >> > >> No, because "= Vector3" specifies an implementation. > >> An mli file is a module interface, and module interfaces never contain > >> implementations. > >> > >> However, you may want to do this, which does what it says: > >> > >> module V3 : module type of Vector3 > > > > > > Thanks a lot! That's exactly what I needed. :) > > > > > > > > > > -- > > Caml-list mailing list. Subscription management and archives: > > https://sympa.inria.fr/sympa/arc/caml-list > > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > > Bug reports: http://caml.inria.fr/bin/caml-bugs > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > --e89a8f839f6f17dcd404ced87ab0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Actually this is not true, Martin explained how. :-)


--
Paolo
Sent by Gmail from Android

Il giorno 19/nov/2012 11:35, "David House&q= uot; <dhouse@janestreet.com= > ha scritto:
Annoyingly though, there is no way to create a module alias in an mli.

If, in an ml file, you have to refer often to
Some_very_long_module_name, it can quite convenient to define an alias
by doing "module Mod =3D Some_very_long_module_name" (or, locally= , "let
module Mod =3D Some_very_long_module_name in"). But there is no way of=
doing this in an mli: you have to use the long name every time.

This is especially annoying if you have some big type that you want to
expose in the mli. You really just want to copy-paste out of the ml
file and stick it into the mli, but then you have to expand all the
module aliases. (It's just a couple of goes with M-%, but still...)

On Mon, Nov 19, 2012 at 6:36 AM, Francois Berenger <berenger@riken.jp> wrote:
> On 11/19/2012 03:02 PM, Martin Jambon wrote:
>>
>> On Sun 18 Nov 2012 09:29:31 PM PST, Francois Berenger wrote:
>>>
>>> Hello,
>>>
>>> Here is my stupid question of the day:
>>> can't I declare the following in a .mli file?
>>>
>>> module V3 =3D Vector3
>>
>>
>> No, because "=3D Vector3" specifies an implementation. >> An mli file is a module interface, and module interfaces never con= tain
>> implementations.
>>
>> However, you may want to do this, which does what it says:
>>
>> =C2=A0 module V3 : module type of Vector3
>
>
> Thanks a lot! That's exactly what I needed. :)
>
>
>
>
> --
> Caml-list mailing list. =C2=A0Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports:
http://caml.inria.fr/bin/caml-bugs

--
Caml-list mailing list. =C2=A0Subscription management and archives:
ht= tps://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs
--e89a8f839f6f17dcd404ced87ab0--