From: Markus Mottl <markus@mail4.ai.univie.ac.at>
To: OCAML <caml-list@inria.fr>
Subject: [Caml-list] inferred module signatures
Date: Mon, 23 Jul 2001 17:23:48 +0200 [thread overview]
Message-ID: <20010723172348.A24670@fichte.ai.univie.ac.at> (raw)
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
reply other threads:[~2001-07-23 15:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20010723172348.A24670@fichte.ai.univie.ac.at \
--to=markus@mail4.ai.univie.ac.at \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox