Loading ...
Sorry, an error occurred while loading the content.
 

module abbreviations in .mli files?

Expand Messages
  • bwv211mail
    Is there a way to get module abbreviations in .mli files? In my .ml files, I frequently do something like this: module Foo = Really_long_verbose_module_name
    Message 1 of 3 , Apr 1, 2002
      Is there a way to get module abbreviations in .mli files?

      In my .ml files, I frequently do something like this:

      module Foo = Really_long_verbose_module_name
      type t = Foo.t list

      But then in the .mli file, I'm forced to use:

      type t = Really_long_verbose_module_name.t list

      This is really painful when these types are used everywhere. I know I
      can do the following in the .mli file:

      type foo_t = Really_long_verbose_module_name.t

      But what I really want is just a shorthand for the module itself.

      Thanks for any assistance.
    • giangiammy
      ... What about using: open Really_long_verbose_module_name type t = t list So you don t write at all the module name? Regards Gianluca
      Message 2 of 3 , Apr 1, 2002
        --- In ocaml_beginners@y..., "bwv211mail" <bwv211mail@y...> wrote:
        > Is there a way to get module abbreviations in .mli files?
        >
        > In my .ml files, I frequently do something like this:
        >
        > module Foo = Really_long_verbose_module_name
        > type t = Foo.t list
        >
        > But then in the .mli file, I'm forced to use:
        >
        > type t = Really_long_verbose_module_name.t list

        What about using:

        open Really_long_verbose_module_name
        type t = t list

        So you don't write at all the module name?

        Regards
        Gianluca
      • bwv211mail
        ... Because modules may have conflicting type names.
        Message 3 of 3 , Apr 2, 2002
          > What about using:
          >
          > open Really_long_verbose_module_name
          > type t = t list
          >
          > So you don't write at all the module name?

          Because modules may have conflicting type names.
        Your message has been successfully submitted and would be delivered to recipients shortly.