From: Yaron Minsky <yminsky@janestreet.com>
To: Hongbo Zhang <bobzhang1988@gmail.com>
Cc: caml-list@inria.fr, Francois Berenger <berenger@riken.jp>,
Malcolm Matalka <mmatalka@gmail.com>
Subject: Re: [Caml-list] Re: automatic extaction of the .mli (and a little more) from the .ml
Date: Fri, 31 May 2013 11:42:00 -0400 [thread overview]
Message-ID: <CACLX4jSxX3GH+amNJv95aAW4Uck2ZB4qq3rZm+Sk9otVQBXnBA@mail.gmail.com> (raw)
In-Reply-To: <51A8BFE4.9060709@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2450 bytes --]
I concur. I think this is largely the accepted wisdom among experienced
OCaml developers.
y
On May 31, 2013 11:21 AM, "Hongbo Zhang" <bobzhang1988@gmail.com> wrote:
> On 5/31/13 1:31 AM, Malcolm Matalka wrote:
>
>> I know of no such tool, but in counter to your premise: I used to think
>> maintaining a .ml and .mli was foolish, however I no longer do. .mli is
>> effectively documentation for me. It contains a lot of comments and is
>> generally written to reflect how the API should be used rather than the
>> order in which I must express functions to get ta .ml to compile. On
>> top of that, ocamlc will fail to compile if your .ml and .mli don't
>> match, so it's a valuable check that what I think my module does is also
>> what the compiler does. I also tend to write the .mli first, then write
>> the .ml. I find it to be a great way to develop.
>>
>> In short, I think it's a good thing to maintain these things by hand.
>> But as for your original question I'm completely useless, sorry.
>>
>> I had the same experience with you, after writing some large software in
> ML, I found it better to maintain mli by hand.
>
>> /M
>>
>> Francois Berenger <berenger@riken.jp> writes:
>>
>> Hello,
>>>
>>> Is there some recommended tool/script to generate a .mli
>>> from the corresponding .ml?
>>>
>>> I want a little more than ocamlc -i:
>>>
>>> - I think there should be tags in the .ml file as comments
>>> that say "export this" to the .mli.
>>> By default, things are not exported.
>>> - maybe it should have an option to say to replicate
>>> the ocamldoc comments in the .mli.
>>> - it could be nice if the order in which things are exported
>>> to the .mli can be specified, maybe as an argument of the tag.
>>> So that the .mli can be more readable (only backward references
>>> to concepts, etc.)
>>>
>>> If there is a need to create a tool, let's call it "nomli". :)
>>>
>>> Regards,
>>> F.
>>>
>>> PS: I'm not going to maintain both a .mli and a .ml.
>>> I feel it is a dumb and error-prone job and that
>>> itches me.
>>>
>>
>>
>
> --
> Caml-list mailing list. Subscription management and archives:
> https://sympa.inria.fr/sympa/**arc/caml-list<https://sympa.inria.fr/sympa/arc/caml-list>
> Beginner's list: http://groups.yahoo.com/group/**ocaml_beginners<http://groups.yahoo.com/group/ocaml_beginners>
> Bug reports: http://caml.inria.fr/bin/caml-**bugs<http://caml.inria.fr/bin/caml-bugs>
>
[-- Attachment #2: Type: text/html, Size: 3371 bytes --]
next prev parent reply other threads:[~2013-05-31 15:42 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-31 3:43 [Caml-list] " Francois Berenger
2013-05-31 5:31 ` Malcolm Matalka
2013-05-31 6:26 ` Francois Berenger
2013-05-31 9:10 ` Romain Bardou
2013-06-03 1:33 ` Francois Berenger
2013-06-04 7:53 ` David Allsopp
2013-06-04 8:22 ` Alain Frisch
2013-06-04 8:54 ` David Allsopp
2013-06-04 8:22 ` Romain Bardou
2013-06-04 9:05 ` David Allsopp
2013-05-31 23:13 ` oliver
2013-06-03 1:28 ` Francois Berenger
2013-06-03 12:01 ` Malcolm Matalka
2013-05-31 15:21 ` [Caml-list] " Hongbo Zhang
2013-05-31 15:42 ` Yaron Minsky [this message]
2013-05-31 23:20 ` Jacques Le Normand
2013-06-01 9:12 ` Florent Monnier
2013-06-03 17:12 ` [Caml-list] " Alain Frisch
2013-06-04 0:30 ` Francois Berenger
2013-06-04 8:36 ` Alain Frisch
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=CACLX4jSxX3GH+amNJv95aAW4Uck2ZB4qq3rZm+Sk9otVQBXnBA@mail.gmail.com \
--to=yminsky@janestreet.com \
--cc=berenger@riken.jp \
--cc=bobzhang1988@gmail.com \
--cc=caml-list@inria.fr \
--cc=mmatalka@gmail.com \
/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