Version française
Home     About     Download     Resources     Contact us    
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:

list_extensions.ml:

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

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

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 :
    sig
      include_sig List
      val public_value : ...
    end

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
http://caml.inria.fr/archives/200107/msg00259.html but I didn't see
any followup.

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

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners