* [Caml-list] Abbreviating module paths - something like "open X as Y"
@ 2015-11-19 10:34 Soegtrop, Michael
2015-11-19 10:35 ` David House
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Soegtrop, Michael @ 2015-11-19 10:34 UTC (permalink / raw)
To: Ocaml Mailing List
[-- Attachment #1: Type: text/plain, Size: 653 bytes --]
Dear OCaml Users,
I wonder if there is a way to abbreviate module paths. Something like
open <module-path> as <acronym>
I usually find it more readable to have a 2 or 3 letter acronym for a module name than having the complete module name or no module name at all. Is there a way to do this in OCaml?
Best regards,
Michael
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
[-- Attachment #2: Type: text/html, Size: 3921 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Caml-list] Abbreviating module paths - something like "open X as Y"
2015-11-19 10:34 [Caml-list] Abbreviating module paths - something like "open X as Y" Soegtrop, Michael
@ 2015-11-19 10:35 ` David House
2015-11-19 10:36 ` Gabriel Scherer
2015-11-19 10:37 ` Francois Berenger
2 siblings, 0 replies; 5+ messages in thread
From: David House @ 2015-11-19 10:35 UTC (permalink / raw)
To: Soegtrop, Michael; +Cc: Ocaml Mailing List
[-- Attachment #1: Type: text/plain, Size: 820 bytes --]
The usual way is "module X = Y".
On 19 November 2015 at 18:34, Soegtrop, Michael <michael.soegtrop@intel.com>
wrote:
> Dear OCaml Users,
>
>
>
> I wonder if there is a way to abbreviate module paths. Something like
>
>
>
> open <module-path> as <acronym>
>
>
>
> I usually find it more readable to have a 2 or 3 letter acronym for a
> module name than having the complete module name or no module name at all.
> Is there a way to do this in OCaml?
>
>
>
> Best regards,
>
>
>
> Michael
>
> Intel Deutschland GmbH
> Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
> Tel: +49 89 99 8853-0, www.intel.de
> Managing Directors: Christin Eisenschmid, Christian Lamprechter
> Chairperson of the Supervisory Board: Nicole Lau
> Registered Office: Munich
> Commercial Register: Amtsgericht Muenchen HRB 186928
>
[-- Attachment #2: Type: text/html, Size: 2926 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Caml-list] Abbreviating module paths - something like "open X as Y"
2015-11-19 10:34 [Caml-list] Abbreviating module paths - something like "open X as Y" Soegtrop, Michael
2015-11-19 10:35 ` David House
@ 2015-11-19 10:36 ` Gabriel Scherer
2015-11-19 10:37 ` Francois Berenger
2 siblings, 0 replies; 5+ messages in thread
From: Gabriel Scherer @ 2015-11-19 10:36 UTC (permalink / raw)
To: Soegtrop, Michael; +Cc: Ocaml Mailing List
[-- Attachment #1: Type: text/plain, Size: 987 bytes --]
Indeed, you can use
module Foo = Bar.Baz
(There is special support for this path-naming-only special case of module
declaration in the type-checker, that makes it work better in some cases.)
On Thu, Nov 19, 2015 at 11:34 AM, Soegtrop, Michael <
michael.soegtrop@intel.com> wrote:
> Dear OCaml Users,
>
>
>
> I wonder if there is a way to abbreviate module paths. Something like
>
>
>
> open <module-path> as <acronym>
>
>
>
> I usually find it more readable to have a 2 or 3 letter acronym for a
> module name than having the complete module name or no module name at all.
> Is there a way to do this in OCaml?
>
>
>
> Best regards,
>
>
>
> Michael
>
> Intel Deutschland GmbH
> Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
> Tel: +49 89 99 8853-0, www.intel.de
> Managing Directors: Christin Eisenschmid, Christian Lamprechter
> Chairperson of the Supervisory Board: Nicole Lau
> Registered Office: Munich
> Commercial Register: Amtsgericht Muenchen HRB 186928
>
[-- Attachment #2: Type: text/html, Size: 3121 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Caml-list] Abbreviating module paths - something like "open X as Y"
2015-11-19 10:34 [Caml-list] Abbreviating module paths - something like "open X as Y" Soegtrop, Michael
2015-11-19 10:35 ` David House
2015-11-19 10:36 ` Gabriel Scherer
@ 2015-11-19 10:37 ` Francois Berenger
2015-11-19 10:48 ` Soegtrop, Michael
2 siblings, 1 reply; 5+ messages in thread
From: Francois Berenger @ 2015-11-19 10:37 UTC (permalink / raw)
To: caml-list
On 11/19/2015 11:34 AM, Soegtrop, Michael wrote:
> Dear OCaml Users,
>
> I wonder if there is a way to abbreviate module paths. Something like
>
> open <module-path> as <acronym>
module L = List
[...]
L.length [1;2;3]
It was advised to me on this same list, several years ago.
> I usually find it more readable to have a 2 or 3 letter acronym for a
> module name than having the complete module name or no module name at
> all. Is there a way to do this in OCaml?
>
> Best regards,
>
> Michael
>
> Intel Deutschland GmbH
> Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
> Tel: +49 89 99 8853-0, www.intel.de
> Managing Directors: Christin Eisenschmid, Christian Lamprechter
> Chairperson of the Supervisory Board: Nicole Lau
> Registered Office: Munich
> Commercial Register: Amtsgericht Muenchen HRB 186928
>
--
Regards,
Francois.
"When in doubt, use more types"
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [Caml-list] Abbreviating module paths - something like "open X as Y"
2015-11-19 10:37 ` Francois Berenger
@ 2015-11-19 10:48 ` Soegtrop, Michael
0 siblings, 0 replies; 5+ messages in thread
From: Soegtrop, Michael @ 2015-11-19 10:48 UTC (permalink / raw)
To: caml-list
Dear David, Gabriel, Francois,
thanks a lot for the quick answer!
> module L = List
> [...]
> L.length [1;2;3]
Quite obvious if you know it ;-) Maybe a hint in the reference manual section "Opening a module path" would help others.
Best regards,
Michael
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-11-19 10:48 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-19 10:34 [Caml-list] Abbreviating module paths - something like "open X as Y" Soegtrop, Michael
2015-11-19 10:35 ` David House
2015-11-19 10:36 ` Gabriel Scherer
2015-11-19 10:37 ` Francois Berenger
2015-11-19 10:48 ` Soegtrop, Michael
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox