Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] inferred module signatures
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Markus Mottl <markus@m...>
Subject: [Caml-list] inferred module signatures
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