From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id UAA27705 for caml-redistribution; Tue, 16 Feb 1999 20:05:29 +0100 (MET) 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 SAA25292 for ; Tue, 16 Feb 1999 18:40:13 +0100 (MET) Received: from mail3.microsoft.com (mail3.microsoft.com [131.107.3.123]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id SAA10191 for ; Tue, 16 Feb 1999 18:40:12 +0100 (MET) Received: by mail3.microsoft.com with Internet Mail Service (5.5.2524.0) id ; Tue, 16 Feb 1999 09:40:11 -0800 Message-ID: <39ADCF833E74D111A2D700805F1951EF0F00B9C5@RED-MSG-06> From: Don Syme To: "'Anton Moscal'" , Christopher Jeris Cc: caml-list@inria.fr Subject: RE: anonymous record types in variants Date: Tue, 16 Feb 1999 09:40:02 -0800 X-Mailer: Internet Mail Service (5.5.2524.0) Sender: weis Again, I've also needed to factorize the common fields of variants as in Anton's example. BTW, the type language of Mercury (and probably some other FP languages?) allows variants and records pretty much anywhere in a type structure. Don > > On Fri, 12 Feb 1999, Christopher Jeris wrote: > > > The argument of a variant type constructor cannot be an > anonymous record > > type, i.e.: > > > > type foo = One of {one: int} | Two of {two: string} > > > > I agree. I often need the following usage of anonymous types: > > type text = int(*length*) * (File of string | Str of string | ...) > > (factorizing of the common fields in the variant types). > > SML allow this construction. Probably an optimal solution would > be to allow anonymous types in any context. > > Regards, > Anton Moscal >