From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id UAA26768; Thu, 22 Mar 2001 20:15:55 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id UAA26707 for ; Thu, 22 Mar 2001 20:15:54 +0100 (MET) Received: from mail3.microsoft.com (mail3.microsoft.com [131.107.3.123]) by nez-perce.inria.fr (8.11.1/8.10.0) with SMTP id f2MJFqT15040 for ; Thu, 22 Mar 2001 20:15:52 +0100 (MET) Received: from 157.54.9.101 by mail3.microsoft.com (InterScan E-Mail VirusWall NT); Thu, 22 Mar 2001 11:14:04 -0800 (Pacific Standard Time) Received: from red-msg-04.redmond.corp.microsoft.com ([157.54.12.74]) by inet-imc-01.redmond.corp.microsoft.com with Microsoft SMTPSVC(5.0.2195.2883); Thu, 22 Mar 2001 11:15:44 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.0.4418.65 Content-Class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [Caml-list] about typedefs... (was: duplication implementation/interface) Date: Thu, 22 Mar 2001 11:15:44 -0800 Message-ID: Thread-Topic: [Caml-list] about typedefs... (was: duplication implementation/interface) Thread-Index: AcCywc6J+caBqnjOS8y/1/Vkd87zDAAQljGw From: "Manuel Fahndrich" To: "Olivier Andrieu" , X-OriginalArrivalTime: 22 Mar 2001 19:15:44.0181 (UTC) FILETIME=[7E040E50:01C0B304] Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Yes, the reason it is needed is to be able to export from a module both a type sharing constraint, and at the same time the concrete type representation. module type I =3D sig module M : J type t =3D M.s =3D { foo : int } end Such a description gives you two pieces of information. M.s =3D t and = also the representation of this type. Regards, Manuel -----Original Message----- From: Olivier Andrieu [mailto:andrieu@oxygene.ijm.jussieu.fr]=20 Sent: Thursday, March 22, 2001 3:17 AM To: caml-list@inria.fr Subject: Re: [Caml-list] about typedefs... (was: duplication implementation/interface) Judicael Courant [Thursday 22 March 2001] : > Brian Rogoff a =E9crit : > >=20 > [...] > > What's the problem with the hack I suggested earlier: put the > > huge variant (and other duplicated types) in a "pure" .mli file > > (I hate using .ml for that) and "open"ing it where you need it, > > once in the .mli file and once in the .ml file? This way you > > reduce the duplication to two lines. > >=20 > > I know some people are open-phobes, but I find this use of open > > to be acceptable. > >=20 >=20 > As for open-phobes, somebody gave me a good solution a few days > ago: you can locally define a module with a very short name. There's something I've been wondering about type definitions : In type definitions, you can specify type equation and representation. - when none is specified, the defined type is abstract ; - when an equation is given, you get an alias of an already existing type ; - with a representation, a new variant or record is defined. But it is possible to use both, so that you get an alias of an already defined variant and record but with the fields or constructors attached to the new type.=20 It don't really see the point of such a definition : now the type representation is in 4 different places, and the only gain I see is that you don't have to prefix the fields names with a module path. That's no big deal since you can redefine the module with a short name (one letter). So, is this form of type definitions actually used, does it have another purpose besides this namespace issue ? Olivier ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr