caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] referencing the signature inferred from a .mli file?
@ 2003-09-07 16:41 Eric C. Cooper
  2003-09-07 23:51 ` Jacques Garrigue
  0 siblings, 1 reply; 4+ messages in thread
From: Eric C. Cooper @ 2003-09-07 16:41 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] referencing the signature inferred from a .mli file?
  2003-09-07 16:41 [Caml-list] referencing the signature inferred from a .mli file? Eric C. Cooper
@ 2003-09-07 23:51 ` Jacques Garrigue
  2003-09-08  7:50   ` Markus Mottl
  2003-09-08  9:25   ` Jean-Baptiste Rouquier
  0 siblings, 2 replies; 4+ messages in thread
From: Jacques Garrigue @ 2003-09-07 23:51 UTC (permalink / raw)
  To: ecc; +Cc: caml-list

From: "Eric C. Cooper" <ecc@cmu.edu>
> Suppose I extend an existing module, like the standard List module,
> with some new functions:
> 
[...]
> 
> 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'm not sure of what is good (or bad) software engineering.
However I'm convinced that this is a real pain.

I had a simple proposal: a .mli file would not only be used as a
constraint for the corresponding .ml file, but would also define
a signature of the same name.
Then you could simply write 
  sig include List ... end

But it has not been accepted yet...

Jacques Garrigue

-------------------
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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] referencing the signature inferred from a .mli file?
  2003-09-07 23:51 ` Jacques Garrigue
@ 2003-09-08  7:50   ` Markus Mottl
  2003-09-08  9:25   ` Jean-Baptiste Rouquier
  1 sibling, 0 replies; 4+ messages in thread
From: Markus Mottl @ 2003-09-08  7:50 UTC (permalink / raw)
  To: Jacques Garrigue; +Cc: ecc, caml-list

On Mon, 08 Sep 2003, Jacques Garrigue wrote:
> I had a simple proposal: a .mli file would not only be used as a
> constraint for the corresponding .ml file, but would also define
> a signature of the same name.
> Then you could simply write 
>   sig include List ... end
> 
> But it has not been accepted yet...

Not yet - but hopefully soon? Please :-)

Regards,
Markus Mottl

-- 
Markus Mottl          http://www.oefai.at/~markus          markus@oefai.at

-------------------
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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] referencing the signature inferred from a .mli file?
  2003-09-07 23:51 ` Jacques Garrigue
  2003-09-08  7:50   ` Markus Mottl
@ 2003-09-08  9:25   ` Jean-Baptiste Rouquier
  1 sibling, 0 replies; 4+ messages in thread
From: Jean-Baptiste Rouquier @ 2003-09-08  9:25 UTC (permalink / raw)
  To: caml-list

>I had a simple proposal: a .mli file would not only be used as a
>constraint for the corresponding .ml file, but would also define
>a signature of the same name.
>Then you could simply write 
>  sig include List ... end
Yes, that would be great.
Jean-Baptiste.




-------------------
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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-09-08  9:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-07 16:41 [Caml-list] referencing the signature inferred from a .mli file? Eric C. Cooper
2003-09-07 23:51 ` Jacques Garrigue
2003-09-08  7:50   ` Markus Mottl
2003-09-08  9:25   ` Jean-Baptiste Rouquier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).