Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] referencing the signature inferred from a .mli file?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Eric C. Cooper <ecc@c...>
Subject: [Caml-list] referencing the signature inferred from a .mli file?
Suppose I extend an existing module, like the standard List module,
with some new functions:

  module List = struct
    (* Include standard List module. *)
    include List

    (* Add some extensions. *)
    let private_value = ...
    let public_value = ...

As far as I can tell, I can't write a list_extensions.mli file without
textually including the standard List .mli file, which isn't very good
software engineering practice.

I would like to write something like

  module List :
      include_sig List
      val public_value : ...

where "include_sig M" is equivalent to including the contents of
the corresponding .mli file for module M. (Maybe the "inherit" keyword
could be re-used for this purpose?)

It looks like Markus Mottl made a similar request in but I didn't see
any followup.

Eric C. Cooper          e c c @ c m u . e d u

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: