From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 533BC7EE42 for ; Tue, 4 Jun 2013 10:54:36 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of dra-news@metastack.com) identity=pra; client-ip=81.103.221.48; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="dra-news@metastack.com"; x-sender="dra-news@metastack.com"; x-conformance=sidf_compatible Received-SPF: Neutral (mail3-smtp-sop.national.inria.fr: domain of dra-news@metastack.com does not assert whether or not 81.103.221.48 is permitted sender) identity=mailfrom; client-ip=81.103.221.48; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="dra-news@metastack.com"; x-sender="dra-news@metastack.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mtaout02-winn.ispmail.ntl.com) identity=helo; client-ip=81.103.221.48; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="dra-news@metastack.com"; x-sender="postmaster@mtaout02-winn.ispmail.ntl.com"; x-conformance=sidf_compatible 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" Received: from mtaout02-winn.ispmail.ntl.com ([81.103.221.48]) by mail3-smtp-sop.national.inria.fr with ESMTP; 04 Jun 2013 10:54:35 +0200 Received: from aamtaout02-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20130604085434.KRFD23282.mtaout02-winn.ispmail.ntl.com@aamtaout02-winn.ispmail.ntl.com> for ; Tue, 4 Jun 2013 09:54:34 +0100 Received: from romulus.metastack.com ([81.102.132.77]) by aamtaout02-winn.ispmail.ntl.com (InterMail vG.3.00.04.00 201-2196-133-20080908) with ESMTP id <20130604085434.KMJL6472.aamtaout02-winn.ispmail.ntl.com@romulus.metastack.com> for ; Tue, 4 Jun 2013 09:54:34 +0100 Received: from remus.metastack.local (remus.metastack.com [172.16.0.1]) by romulus.metastack.com (8.14.2/8.14.2) with ESMTP id r548sWC9007661 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL) for ; Tue, 4 Jun 2013 09:54:32 +0100 Received: from Remus.metastack.local ([fe80::547c:3c42:e1da:eda2]) by Remus.metastack.local ([fe80::547c:3c42:e1da:eda2%10]) with mapi id 14.03.0123.003; Tue, 4 Jun 2013 09:54:32 +0100 From: David Allsopp To: "caml-list@inria.fr" Thread-Topic: [Caml-list] automatic extaction of the .mli (and a little more) from the .ml Thread-Index: AQHOXbEfSaBAF3FKQU2pLmZI8Q/+85kexO87///+Z4CAAC3YAIAGQFww///7ewCAABl7UA== Date: Tue, 4 Jun 2013 08:54:31 +0000 Message-ID: References: <51A81C67.50902@riken.jp> <87bo7rogub.fsf@gmail.com> <51A84283.80309@riken.jp> <51A868F8.9050101@inria.fr> <51ADA3A8.7070008@frisch.fr> In-Reply-To: <51ADA3A8.7070008@frisch.fr> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.16.0.18] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Organization: MetaStack Solutions Ltd. 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 Subject: RE: [Caml-list] automatic extaction of the .mli (and a little more) from the .ml 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: >=20 > 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 be= tter to do it the other way around (given that installing .mli files is qui= te common, for example). =20 > 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: >=20 > type t =3D [%copy_typedef] This is very cool - will have to check out this branch and have a play when= I have a moment! David