* [Caml-list] inferred module signatures
@ 2001-07-23 15:23 Markus Mottl
0 siblings, 0 replies; only message in thread
From: Markus Mottl @ 2001-07-23 15:23 UTC (permalink / raw)
To: OCAML
Hello,
sorry for polluting this list with too many mails in too short a time...
Having experimented around with the module system to find more convenient
ways of separating signatures and implementations in different files,
it seems to me that the main problem boils down to the impossibility of
referring to the inferred signature of modules, e.g.:
This is not possible (restricting the type of functor arguments using
the name of a module that implements such a type):
file: foo.mli
-------------------------------------------------------------------------
type t
val x : t -> t
-------------------------------------------------------------------------
file: bar.ml
-------------------------------------------------------------------------
module Make (M : Foo) = struct end
-------------------------------------------------------------------------
This is also not possible (same reason):
file: foo.mli
-------------------------------------------------------------------------
module Sig = struct
type t
end
module type FOO = sig
include Sig
end
-------------------------------------------------------------------------
I am not sure whether this proposal is useful, but wouldn't it be nice
if the inferred signature of an existing module of the referred name
could be taken when there is no module type bound to the same name? This
would simplify many things greatly, especially working with heavily
functorized code.
Furthermore, it might also be useful in this context to interpret
filenames of modules differently, i.e. to ignore the case of the first
char: module (type) names always start out uppercase but a filename with
an uppercase initial char cannot be used (a bit inconsistent, IMHO). It
would really look ugly if somebody had to name a file "fOO.mli" instead of
"FOO.mli" if he really means to name some signature "FOO".
Best regards,
Markus Mottl
--
Markus Mottl markus@oefai.at
Austrian Research Institute
for Artificial Intelligence http://www.oefai.at/~markus
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-07-23 15:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-23 15:23 [Caml-list] inferred module signatures Markus Mottl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox