caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Oliver Bandel <oliver@first.in-berlin.de>
To: "Daniel Bünzli" <daniel.buenzli@erratique.ch>
Cc: Francois Berenger <berenger@riken.jp>,
	"caml-list@inria.fr" <caml-list@inria.fr>
Subject: Re: [Caml-list] Re: Why should I use .mli files?
Date: Wed, 31 Oct 2012 10:51:17 +0100	[thread overview]
Message-ID: <C43C57CE-13AE-4B4E-8F59-D8FD2FA94F52@first.in-berlin.de> (raw)
In-Reply-To: <50908263.7050806@erratique.ch>



Am 31.10.2012 um 02:44 schrieb Daniel Bünzli <daniel.buenzli@erratique.ch>:

> Francois Berenger a écrit :
> > On 10/30/2012 09:28 PM, Daniel Bünzli wrote:
> >> I personnally find none of these arguments very compelling.
> >
> > "don't take it personally" ;)
> 
> Well... really !
> 
>> In the first place, I don't want to write those .mli files as the
>> compiler can infer them for me automatically (I'm lazy).
> 
> Sure, but it infers the most flexible one and there are many case where this is not desired. For example if you want to use typing tricks for correctness like phantom types you must write mli files.
> 
> And at the risk of repeating myself, knowing by a quick glance what is internal/external to a module is also very useful information, e.g. if you intend to rewrite its functionality. The compiler cannot know what's really important for the clients of the module, it exports everything. Consider mli files as cheap documentation.
[...]

The point, some peoplembrought in, was, that after changing the ml-file,
the mli is thenold one nevertheless. This also, means, that ocamlc -i
will not help here.
Thenmli file first mustbbe removed or renamed, to get the output for the changed
ml-file.
This also has annoyed me sometimes, when I wanted to to get the new
default signature.

A solution to this problem could be, to have a --force flag, so that
ocamlc -i --force would print the default-signature of the raw ml-file,
as if the mli file corrosponding to it would not exist.
Then the forced ocamlc would print the whole sig of the ml.
One could pick out the new stuff then.

Or a   ocamlc -i --force --diff
could print a diff of the signatures of the raw ml-file with unused mli
to the signature which is forced by the mli-file.

In this way the needed functionality of generating mli-content would be
achieved, without changing the classical behaviour of the mli-files.
And an implementation seems also to be also comparingly easy.

And I would not insist on "--force" and "--diff" as being best choices,
but it was just to explain what is meant as proposal.


Best regards,
   Oliver

  reply	other threads:[~2012-10-31  9:51 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-30  0:43 [Caml-list] " Francois Berenger
2012-10-30  1:04 ` Peter Groves
2012-10-30  2:21   ` Francois Berenger
2012-10-30  1:15 ` malc
2012-10-30  2:24   ` Francois Berenger
2012-10-30 10:23     ` malc
2012-10-30  1:19 ` Daniel Bünzli
2012-10-30  2:36   ` Francois Berenger
2012-10-30  3:26     ` Anthony Tavener
2012-10-30 12:28     ` Daniel Bünzli
2012-10-31  0:53       ` Francois Berenger
2012-10-30  2:21 ` gallais @ ensl.org
2012-10-30  6:12 ` Anton Lavrik
2012-10-30  9:18   ` Francois Berenger
2012-10-30 10:01     ` Malcolm Matalka
2012-10-30 11:03     ` Richard W.M. Jones
2012-10-30 11:41     ` [Caml-list] " Hongbo Zhang
2012-10-30 13:31       ` Romain Bardou
2012-10-31  1:03         ` Francois Berenger
2012-10-31  1:44           ` Daniel Bünzli
2012-10-31  9:51             ` Oliver Bandel [this message]
2012-10-30 14:32   ` [Caml-list] " Oliver Bandel
2012-10-30 14:45     ` Anton Lavrik
2012-10-30 14:49       ` Oliver Bandel
2012-10-30 14:51       ` Didier Cassirame
2012-10-30 14:47     ` Romain Bardou
2012-10-30 16:06       ` Edgar Friendly
2012-10-30 16:21         ` Romain Bardou
2012-10-30 16:46           ` Edgar Friendly
2012-10-30 21:25             ` Gabriel Scherer
2012-10-30 22:18               ` Oliver Bandel
2012-10-31  9:25                 ` Gabriel Scherer
2012-10-31  9:59                   ` Daniel Bünzli
2012-10-31 13:22                     ` Edgar Friendly
2012-10-31 13:38                       ` Daniel Bünzli
2012-10-31 13:55                         ` Edgar Friendly
2012-10-31 13:43                       ` Gabriel Scherer
2012-11-01  0:38                         ` Francois Berenger
2012-11-01  0:42                           ` Edgar Friendly
2012-11-01  0:52                             ` Francois Berenger
2012-11-01  2:06                               ` Edgar Friendly
2012-11-01  2:37                                 ` Francois Berenger
2012-11-01  2:44                                 ` Jacques Garrigue
2012-11-01  7:45                                   ` Andreas Rossberg
2012-10-31 10:20               ` Alain Frisch
2012-10-31 13:50               ` Edgar Friendly
2012-10-31 15:12                 ` Gabriel Scherer
2012-10-31 16:48                   ` Edgar Friendly
2012-10-31 17:15                     ` Gabriel Scherer
2012-10-31 19:05                       ` Tiphaine Turpin
2012-10-30  7:43 ` Mike Lin
2012-10-30 15:52 ` Didier Cassirame
2012-10-30 15:56   ` Romain Bardou
2012-10-30 16:14     ` Didier Cassirame
2012-10-31 21:30   ` Oliver Bandel
2012-11-01 15:26     ` Didier Cassirame
2012-10-31 15:32 ` Alain Frisch
2012-10-31 17:32   ` Tiphaine Turpin
2012-10-31 21:40     ` Oliver Bandel

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=C43C57CE-13AE-4B4E-8F59-D8FD2FA94F52@first.in-berlin.de \
    --to=oliver@first.in-berlin.de \
    --cc=berenger@riken.jp \
    --cc=caml-list@inria.fr \
    --cc=daniel.buenzli@erratique.ch \
    /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;
as well as URLs for NNTP newsgroup(s).