🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fa.caml
Article #34

[Caml-list] Re: automatic extaction of the .mli (and a little more) from the .ml

#34
From: Hongbo Zhang
Date: Fri, 31 May 2013 15:21
53 lines
5789 bytes
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
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs
Technical Details
Message-ID: <fa.I3TrHR6XgRrV1HNzzkfzl27QRCQ@ifi.uio.no>
Path: arc1-ca.pugleaf.net!bp1ni27600pbd.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
References: <fa.ysPYFL5+u0NnfGu8UBtNleD9SeQ@ifi.uio.no> <fa.OQroQDVDk9br1ZhQEIL1NaakR5I@ifi.uio.no>

Show Full Headers
Complete Article Headers
X-Google-Thread: c0fe4b917e,bcac4a6e27ff55dd,start
X-Google-Attributes: gidc0fe4b917e,public,usenet
X-Google-NewGroupId: yes
X-Google-Language: ENGLISH,ASCII-7-bit
X-Received: by 10.66.189.195 with SMTP id gk3mr2614892pac.16.1370013683611;
        Fri, 31 May 2013 08:21:23 -0700 (PDT)
Path: arc1-ca.pugleaf.net!bp1ni27600pbd.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: Hongbo Zhang <bobzhang1988@gmail.com>
Newsgroups: fa.caml
Subject: [Caml-list] Re: automatic extaction of the .mli (and a little more)
 from the .ml
Date: Fri, 31 May 2013 15:21:23 UTC
Organization: Internet mailing list
Lines: 53
Sender: caml-list-request@inria.fr
Message-ID: <fa.I3TrHR6XgRrV1HNzzkfzl27QRCQ@ifi.uio.no>
References: <fa.ysPYFL5+u0NnfGu8UBtNleD9SeQ@ifi.uio.no> <fa.OQroQDVDk9br1ZhQEIL1NaakR5I@ifi.uio.no>
NNTP-Posting-Host: mail-jess.uio.no
Mime-Version: 1.0
X-Trace: readme.uio.no 1370013683 15844 129.240.7.9 (31 May 2013 15:21:23 GMT)
X-Complaints-To: abuse@uio.no
NNTP-Posting-Date: Fri, 31 May 2013 15:21:23 +0000 (UTC)
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130328 Thunderbird/17.0.5
Cc: Francois Berenger <berenger@riken.jp>, caml-list <caml-list@inria.fr>
To: Malcolm Matalka <mmatalka@gmail.com>
X-IronPort-AV: E=Sophos;i="4.87,779,1363129200"; 
   d="scan'208";a="19809877"
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: AvwAAJK+qFHRVdyrlGdsb2JhbABawiOBAhYOAQEBAQcLCwkSKoIjAQEBBAEBATUIARscAQEDDAYFCwMKCRYPCQMCAQIBEREBBQEcBg0BBQIBAYd2AQMPnGOMSoJ9hQAKGScNWIgGAQUMjxUHg1cDk22DUY9bP4RR
X-IPAS-Result: AvwAAJK+qFHRVdyrlGdsb2JhbABawiOBAhYOAQEBAQcLCwkSKoIjAQEBBAEBATUIARscAQEDDAYFCwMKCRYPCQMCAQIBEREBBQEcBg0BBQIBAYd2AQMPnGOMSoJ9hQAKGScNWIgGAQUMjxUHg1cDk22DUY9bP4RR
X-IronPort-AV: E=Sophos;i="4.87,779,1363129200"; 
   d="scan'208";a="19809836"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=message-id:date:from:user-agent:mime-version:newsgroups:to:cc
         :subject:references:in-reply-to:content-type
         :content-transfer-encoding;
        bh=azFRIIj+gszPQf/DdS5Fw03H6z0L9Frh+9IQQP/Ksb8=;
        b=UYYTMc6VkLDkdcBBaYcMJIi+t7f1KJazMOoY119jaQa7snySPfm4RmwVjG3IXb2EI1
         iQG1/vEyBFglEONeeoKIp97ISTYbpMlMR/N9gvir+7gnSCjq7MrGLYydf4TM0idLx061
         sCSUvF6/qqDQh0eyNMloeuoKF0wbonNNtQLgvehX2WwH+sHL3QQtGgGaRCZjAnn4PP9q
         D+sYrkClLnJrOOn5P/uBWDhfkU+tt806FJdJt5FdwbZTSLySAfzOtm8PMj0S5rMXJa7a
         r6CtwSYi3ZMQW12YJVZrW8sFwnNCo/ZCUcl49szozBkPvfxpmufPRa8ae/g4p2vKAH3s
         Nwqw==
X-Received: by 10.220.3.144 with SMTP id 16mr10632079vcn.6.1370013670315;
        Fri, 31 May 2013 08:21:10 -0700 (PDT)
In-Reply-To: <87bo7rogub.fsf@gmail.com>
X-Sequence: 6859
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>
Original-Date: Fri, 31 May 2013 11:21:08 -0400
Original-Newsgroups: gmane.comp.lang.caml.inria
Original-Message-Id: <51A8BFE4.9060709@gmail.com>
Original-References: <51A81C67.50902@riken.jp> <87bo7rogub.fsf@gmail.com>
X-Received-Bytes: 5395
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit