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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by sympa.inria.fr (Postfix) with ESMTPS id ABE477EE20 for ; Mon, 19 Nov 2012 11:35:29 +0100 (CET) Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of dhouse@janestreet.com) identity=pra; client-ip=38.105.200.229; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="dhouse@janestreet.com"; x-sender="dhouse@janestreet.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail1-smtp-roc.national.inria.fr: domain of dhouse@janestreet.com designates 38.105.200.229 as permitted sender) identity=mailfrom; client-ip=38.105.200.229; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="dhouse@janestreet.com"; x-sender="dhouse@janestreet.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@tot-dmz-mxout1.janestreet.com) identity=helo; client-ip=38.105.200.229; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="dhouse@janestreet.com"; x-sender="postmaster@tot-dmz-mxout1.janestreet.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjMBAGAKqlAmacjlmWdsb2JhbABFsCWTESsBAQEBAQgLCwcUJ4IeAQEFQAEBLAsBDwsLDQ0hIhIBBQEKEgYTEodpAw8DAQehFYp0hDcBBYR6A4lYBow0hQ2Vf4EcjUYWKYQRghk X-IronPort-AV: E=Sophos;i="4.83,278,1352070000"; d="scan'208";a="182126466" Received: from mx5.janestreet.com (HELO tot-dmz-mxout1.janestreet.com) ([38.105.200.229]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 19 Nov 2012 11:35:28 +0100 Received: from tot-smtp.delacy.com ([172.27.22.35] helo=tot-is-smtp) by tot-dmz-mxout1.janestreet.com with esmtp (Exim 4.76) (envelope-from ) id 1TaOhI-0000x1-Vn for caml-list@inria.fr; Mon, 19 Nov 2012 05:35:24 -0500 Received: from tot-dmz-mxgoog1.delacy.com ([172.27.224.14] helo=mxgoog2.janestreet.com) by tot-is-smtp with esmtps (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1TaOhI-0002am-Su for caml-list@inria.fr; Mon, 19 Nov 2012 05:35:24 -0500 Received: from mail-we0-f198.google.com ([74.125.82.198]) by mxgoog2.janestreet.com with esmtp (Exim 4.76) (envelope-from ) id 1TaOhI-0000i0-Qs for caml-list@inria.fr; Mon, 19 Nov 2012 05:35:24 -0500 Received: by mail-we0-f198.google.com with SMTP id d7so312008wer.9 for ; Mon, 19 Nov 2012 02:35:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=thj0K+vEe2Ees7iF4LU8smLj2mLpgyx36qDrq6C1cjM=; b=fGRiSS0Je/UFEaJC4KA90PJvpWAVD4YjdTXxK9qROTnR0pB85Qes0tifw9NGFy2Wud PojC5lfis4kChsxg6+tUvSK+taP+iWjl56xS4pEvWYgsb6ZgkR8Wf7qXPQiCnf0SRzyW Fsrihdc95CcnF+umwCMbhv76J75E7gWfDMxwc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:cc:content-type:x-gm-message-state; bh=thj0K+vEe2Ees7iF4LU8smLj2mLpgyx36qDrq6C1cjM=; b=oLTi1s3rA+BExvMX7FEmin/wFQ+Z5lvALX3Iss0xuYSbP24XnTv8wKiFWUZfX9oXt2 TYDQce9CXxWDQwdxviMeG9vfaV8qThYvDKhDC1kl6DRRyEAlEov56E5WYHGfYHiLQ4/d ika1g/ZKZxYa9ltnnUDR6rdl0ntoN/MjO1EMHmGs/UJOCRn3BHMlNnVIjpCWZhrcuYRt nrUXDRvitAMArjJheFk0lFExbVZ+POZ5feum3I0FTbFSoH+x+CPYbRtUfLr1I7ABqGvh WdIQlMjNwvIQs0i46nI8AuiUaOyS3z2/gywlrbi1itzmf98FmYFdkH+bBnwCfBP+EN4l HSdg== Received: by 10.204.131.78 with SMTP id w14mr2219208bks.83.1353321324149; Mon, 19 Nov 2012 02:35:24 -0800 (PST) MIME-Version: 1.0 Received: by 10.204.131.78 with SMTP id w14mr2219204bks.83.1353321324006; Mon, 19 Nov 2012 02:35:24 -0800 (PST) Received: by 10.204.35.77 with HTTP; Mon, 19 Nov 2012 02:35:23 -0800 (PST) X-Originating-IP: [80.169.196.210] In-Reply-To: <50A9D378.4020403@riken.jp> References: <50A9C3BB.2050900@riken.jp> <50A9CB66.1020207@ens-lyon.org> <50A9D378.4020403@riken.jp> Date: Mon, 19 Nov 2012 10:35:23 +0000 Message-ID: From: David House To: Francois Berenger Cc: caml-list@inria.fr Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQnMhVSgyOgncvk/Hmsoccc8dZW6O1s/PyvLaLac7UD5AiEyhOG8lIzTHoxXk13JJPwEzFOcj6WvoJi0+3y2qFPBkDrhitVH5UfY08wuZCw70zte3gfBhIaov8N/XOBHByDCPD/+pJLjiH5g/vrLJ/fXo42CLg== Subject: Re: [Caml-list] module alias in a .mli file 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