Article View: fa.caml
Article #56RE: [Caml-list] automatic extaction of the .mli (and a little more) from the .ml
From: David Allsopp
Date: Tue, 04 Jun 2013 08:54
Date: Tue, 04 Jun 2013 08:54
30 lines
4783 bytes
4783 bytes
Alain Frisch wrote: > On 06/04/2013 09:53 AM, David Allsopp wrote: > > I have wondered if this problem is perhaps looked at the wrong way > > around - in other words, the complaint takes the form "how can we > > export to the .mli file automatically" rather than "how can we > > *import* from the .ml file automatically". The thing I do find > > irritating maintaining .mli/.ml files is having to type anything out > > twice - and for the most part that means fully exported type > > declarations. Say you have a simple module: > > I'd rather do it the other way around: maintain the type declaration in > the .mli and import it in the .ml file. My thinking was that the type declaration is part of the implementation at that point so should be in the .ml file - but actually I agree that it's better to do it the other way around (given that installing .mli files is quite common, for example). > And, guess what, there is also a POC of such a tool in the > extension_points branch. It allows you to write in the .ml file: > > type t = [%copy_typedef] This is very cool - will have to check out this branch and have a play when I have a moment! David -- 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.HCVucXqkCwP/jQ7cxU1FBT4u9Rk@ifi.uio.no>Path:
arc1-ca.pugleaf.net!bp1ni803pbd.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.bD6TGMY7hcijji7TE20fgVNMYJ0@ifi.uio.no> <fa.kLitjS6+thDvPu069t19jM9fjnc@ifi.uio.no> <fa.1Prz+i/q1iTOfA4HYPhd0lmmYco@ifi.uio.no> <fa.vZ9CoH7+DZuJ8+hvyvnnFAinU3A@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.67.1.8 with SMTP id bc8mr4044550pad.35.1370336091969;
Tue, 04 Jun 2013 01:54:51 -0700 (PDT)
Path: arc1-ca.pugleaf.net!bp1ni803pbd.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: David Allsopp <dra-news@metastack.com>
Newsgroups: fa.caml
Subject: RE: [Caml-list] automatic extaction of the .mli (and a little more)
from the .ml
Date: Tue, 04 Jun 2013 08:54:51 UTC
Organization: MetaStack Solutions Ltd.
Lines: 30
Sender: caml-list-request@inria.fr
Message-ID: <fa.HCVucXqkCwP/jQ7cxU1FBT4u9Rk@ifi.uio.no>
References: <fa.ysPYFL5+u0NnfGu8UBtNleD9SeQ@ifi.uio.no> <fa.bD6TGMY7hcijji7TE20fgVNMYJ0@ifi.uio.no> <fa.kLitjS6+thDvPu069t19jM9fjnc@ifi.uio.no> <fa.1Prz+i/q1iTOfA4HYPhd0lmmYco@ifi.uio.no> <fa.vZ9CoH7+DZuJ8+hvyvnnFAinU3A@ifi.uio.no>
NNTP-Posting-Host: mail-jess.uio.no
Mime-Version: 1.0
X-Trace: readme.uio.no 1370336091 5187 129.240.7.9 (4 Jun 2013 08:54:51 GMT)
X-Complaints-To: abuse@uio.no
NNTP-Posting-Date: Tue, 4 Jun 2013 08:54:51 +0000 (UTC)
To: "caml-list@inria.fr" <caml-list@inria.fr>
X-IronPort-AV: E=Sophos;i="4.87,798,1363129200";
d="scan'208";a="20208924"
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: AlsAAOKprVFRZ90wlGdsb2JhbABZgmi8coJogQIWDgEBAQEHDQkJFAMeB4IjAQEBAwE6RAsCAQgYChQQMiUCBBuHfwcDvSSOdTiCd2EDlz6TGIE3gic
X-IPAS-Result: AlsAAOKprVFRZ90wlGdsb2JhbABZgmi8coJogQIWDgEBAQEHDQkJFAMeB4IjAQEBAwE6RAsCAQgYChQQMiUCBBuHfwcDvSSOdTiCd2EDlz6TGIE3gic
X-IronPort-AV: E=Sophos;i="4.87,798,1363129200";
d="scan'208";a="16678966"
Thread-Topic: [Caml-list] automatic extaction of the .mli (and a little
more) from the .ml
Thread-Index: AQHOXbEfSaBAF3FKQU2pLmZI8Q/+85kexO87///+Z4CAAC3YAIAGQFww///7ewCAABl7UA==
In-Reply-To: <51ADA3A8.7070008@frisch.fr>
Accept-Language: en-GB, en-US
x-originating-ip: [172.16.0.18]
X-Scanned-By: MIMEDefang 2.65 on 172.16.0.20
X-Cloudmark-Analysis: v=1.1 cv=AUhbpHVS+xhHrj9wLCYAQoYnFLYUZdbP8UM0GmH2jwk= c=1 sm=0 a=IXlcok0kcmcA:10 a=WqH6JILulzsA:10 a=cTs9vV391PwA:10 a=kj9zAlcOel0A:10 a=xqWC_Br6kY4A:10 a=ktvzW_mC-wHJvUuXyBcA:9 a=CjuIK1q_8ugA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117
X-Sequence: 6886
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: Tue, 4 Jun 2013 08:54:31 +0000
Original-Message-Id: <E51C5B015DBD1348A1D85763337FB6D9CC7F492B@Remus.metastack.local>
Original-References: <51A81C67.50902@riken.jp> <87bo7rogub.fsf@gmail.com>
<51A84283.80309@riken.jp> <51A868F8.9050101@inria.fr>
<E51C5B015DBD1348A1D85763337FB6D9CC7F39B8@Remus.metastack.local>
<51ADA3A8.7070008@frisch.fr>
X-Received-Bytes: 4401
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 8bit
Content-Language: en-US