Article View: fa.caml
Article #35Re: [Caml-list] Re: automatic extaction of the .mli (and a little more) from the .ml
From: Yaron Minsky
Date: Fri, 31 May 2013 15:42
Date: Fri, 31 May 2013 15:42
69 lines
7170 bytes
7170 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> > -- Caml-list mailing list. Subscription management and archives: https://sympa.inria.fr/sympa/arc/caml-list Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Technical Details
Message-ID:
<fa.YdMuLW3vGvTSY8aKZfxHDvl12Iw@ifi.uio.no>Path:
arc1-ca.pugleaf.net!bp1ni27637pbd.1!nntp.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!news.glorb.com!uio.no!nntp.uio.no!.POSTED!not-for-mailReferences:
<fa.ysPYFL5+u0NnfGu8UBtNleD9SeQ@ifi.uio.no> <fa.OQroQDVDk9br1ZhQEIL1NaakR5I@ifi.uio.no> <fa.I3TrHR6XgRrV1HNzzkfzl27QRCQ@ifi.uio.no>Show Full Headers
Complete Article Headers
X-Google-Thread: c0fe4b917e,bcac4a6e27ff55dd
X-Google-Attributes: gidc0fe4b917e,public,usenet
X-Google-NewGroupId: yes
X-Google-Language: ENGLISH,ASCII-7-bit
X-Received: by 10.66.250.226 with SMTP id zf2mr2579629pac.18.1370014936289;
Fri, 31 May 2013 08:42:16 -0700 (PDT)
Path: arc1-ca.pugleaf.net!bp1ni27637pbd.1!nntp.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!news.glorb.com!uio.no!nntp.uio.no!.POSTED!not-for-mail
From: Yaron Minsky <yminsky@janestreet.com>
Newsgroups: fa.caml
Subject: Re: [Caml-list] Re: automatic extaction of the .mli (and a little
more) from the .ml
Date: Fri, 31 May 2013 15:42:15 UTC
Organization: Internet mailing list
Lines: 75
Sender: caml-list-request@inria.fr
Message-ID: <fa.YdMuLW3vGvTSY8aKZfxHDvl12Iw@ifi.uio.no>
References: <fa.ysPYFL5+u0NnfGu8UBtNleD9SeQ@ifi.uio.no> <fa.OQroQDVDk9br1ZhQEIL1NaakR5I@ifi.uio.no> <fa.I3TrHR6XgRrV1HNzzkfzl27QRCQ@ifi.uio.no>
NNTP-Posting-Host: mail-jess.uio.no
Mime-Version: 1.0
X-Trace: readme.uio.no 1370014935 17071 129.240.7.9 (31 May 2013 15:42:15 GMT)
X-Complaints-To: abuse@uio.no
NNTP-Posting-Date: Fri, 31 May 2013 15:42:15 +0000 (UTC)
Cc: caml-list@inria.fr, Francois Berenger <berenger@riken.jp>,
Malcolm Matalka <mmatalka@gmail.com>
To: Hongbo Zhang <bobzhang1988@gmail.com>
X-IronPort-AV: E=Sophos;i="4.87,779,1363129200";
d="scan'208";a="19813091"
X-Original-To: caml-list@sympa.inria.fr
Delivered-To: caml-list@sympa.inria.fr
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AoUAAErDqFEmacjlnGdsb2JhbABagzmsSYlniDt6Hg4BAQEBAQYNCQkUKIIjAQEEAUABASwLAQQLCwsDCg0hIQESAQUBChIGExKHaQMJBgMJnFaLCYQ+AQWFPgMKiF4GjEiCVQQHg1eTcIFrgWaBKYp0gz4WKYJaJIFT
X-IPAS-Result: AoUAAErDqFEmacjlnGdsb2JhbABagzmsSYlniDt6Hg4BAQEBAQYNCQkUKIIjAQEEAUABASwLAQQLCwsDCg0hIQESAQUBChIGExKHaQMJBgMJnFaLCYQ+AQWFPgMKiF4GjEiCVQQHg1eTcIFrgWaBKYp0gz4WKYJaJIFT
X-IronPort-AV: E=Sophos;i="4.87,779,1363129200";
d="scan'208";a="19813064"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=janestreet.com; s=google;
h=mime-version:in-reply-to:references:date:message-id:subject:from:to
:cc:content-type;
bh=MQMJI3MwbJKIL7GVgR16u1hYWtBo4xnfjW+dNVuJMTg=;
b=R05Q37S3udq409LLVtCP+V1m0gYpSAfjwSe2KZv1LxFb4YAG59g1ICjdC7SnNF3qLe
ECNu77DSVMEYI9kozb0iN6P69RRlaojdfoM/GCDspZhYXB0QtKogi0Eo4jjcO/EFfAol
t+4ui2nZzxAo6RvpvwkQfHtL/AoMU8jEHBMnM=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=google.com; s=20120113;
h=mime-version:in-reply-to:references:date:message-id:subject:from:to
:cc:content-type:x-gm-message-state;
bh=MQMJI3MwbJKIL7GVgR16u1hYWtBo4xnfjW+dNVuJMTg=;
b=F9j7sf26vOR/Vwz0TtFVtzOBhh5ZHHp1pAgI6PUdisWbitiOVBqcy7rOPRTHT36EqK
dposqlVqW1w7/QKzRLi7RqP+bIBNSAYSzmLnDBohcOzBaxBSGq4MHfr0s7vqRSJdLydH
Mvxj5aaWVsZg6oEQWO1MXLUZh7bs2AkeWWNEEyEjXdCIbAgosOjgJ3W0wnm1KkYNfn7m
wc6GOlIhBwbf0Yput04arlcWZKnMUAH575BInFLxp6eECkTcA18qlIb0HOuFoT8i1uvH
xhW3cCK0X4Qck52c5tbM+XZQfCuUTTRczNuJy6rE/rWQG8nRP6p9IX8QAkBHDj/ioiaM
NoYQ==
X-Received: by 10.14.202.71 with SMTP id c47mr13998294eeo.87.1370014921421;
Fri, 31 May 2013 08:42:01 -0700 (PDT)
X-Received: by 10.14.202.71 with SMTP id c47mr13998284eeo.87.1370014921322;
Fri, 31 May 2013 08:42:01 -0700 (PDT)
In-Reply-To: <51A8BFE4.9060709@gmail.com>
X-Gm-Message-State: ALoCoQlrBfc6zZlpk6kE1JN/E1s25sXfesW+D2dsBlU+tXYTYUUY1wEd24OvScK+sSd932nLJvw5mEBQFYgQsrepFWEK744LjUkdMF5/+pbPdJT9JN1L8AFrtGKgw22+apITcQOKq0/CUOTrzK9tJWh+e7ellU6prg==
X-Sequence: 6860
X-no-archive: yes
List-Id: <caml-list.inria.fr>
List-Archive: <http://sympa.inria.fr/sympa/arc/caml-list>
List-Help: <mailto:sympa_inria@inria.fr?subject=help>
List-Owner: <mailto:caml-list-request@inria.fr>
List-Post: <mailto:caml-list@inria.fr>
List-Subscribe: <mailto:sympa_inria@inria.fr?subject=subscribe%20caml-list>
List-Unsubscribe: <mailto:sympa_inria@inria.fr?subject=unsubscribe%20caml-list>
X-FA-Processed: Removed HTML alternative
Original-Date: Fri, 31 May 2013 11:42:00 -0400
Original-Message-Id: <CACLX4jSxX3GH+amNJv95aAW4Uck2ZB4qq3rZm+Sk9otVQBXnBA@mail.gmail.com>
Original-References: <51A81C67.50902@riken.jp>
<87bo7rogub.fsf@gmail.com>
<51A8BFE4.9060709@gmail.com>
X-Received-Bytes: 6928
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit