From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA06079; Mon, 23 Jul 2001 17:23:50 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA06073 for ; Mon, 23 Jul 2001 17:23:49 +0200 (MET DST) Received: from fichte.ai.univie.ac.at (fichte.ai.univie.ac.at [131.130.174.156]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f6NFNmL07816 for ; Mon, 23 Jul 2001 17:23:48 +0200 (MET DST) Received: (from markus@localhost) by fichte.ai.univie.ac.at (8.9.3/8.9.3/Debian 8.9.3-21) id RAA08192 for caml-list@inria.fr; Mon, 23 Jul 2001 17:23:48 +0200 Date: Mon, 23 Jul 2001 17:23:48 +0200 From: Markus Mottl To: OCAML Subject: [Caml-list] inferred module signatures Message-ID: <20010723172348.A24670@fichte.ai.univie.ac.at> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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