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


--
Paolo
Sent by Gmail from Android

Il giorno 19/nov/2012 11:35, "David House" <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 = 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 <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 = 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