From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: dsyme@microsoft.com Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA09093 for ; Thu, 4 Nov 1999 18:53:32 +0100 (MET) Received: from inet-vrs-02.microsoft.com (mail2.microsoft.com [131.107.3.124]) by concorde.inria.fr (8.8.7/8.8.7) with SMTP id SAA22960 for ; Thu, 4 Nov 1999 18:53:30 +0100 (MET) Received: from 157.54.9.104 by inet-vrs-02.microsoft.com (InterScan E-Mail VirusWall NT); Thu, 04 Nov 1999 09:50:56 -0800 (Pacific Standard Time) Received: by INET-IMC-02 with Internet Mail Service (5.5.2650.21) id ; Thu, 4 Nov 1999 06:30:30 -0800 Message-ID: <39ADCF833E74D111A2D700805F1951EF18014278@RED-MSG-06> From: Don Syme To: "'William Chesters'" Cc: caml-redistribution@pauillac.inria.fr Subject: RE: Record typing question Date: Thu, 4 Nov 1999 06:30:26 -0800 X-Mailer: Internet Mail Service (5.5.2650.21) >Spooky, I raised this point a few days ago! Ah ha - I see that now. I haven't been keeping up to date with the discussion list! > type 'a foo = { a: 'a; b: 'a } > let f x = { x with a = 1 } > Here "f: 'a foo -> int foo" won't wash, because the "b" field will > stay an int, contra the definition. Before lifting the current > restriction, one would have to check that no type equalities between > fields are broken. I guess it should be f: int foo -> int foo. All the field assignments would act in parallel as far as the type system goes, so type 'a foo = { a: 'a; b: 'a; c: int } let f x = { x with a = [x.a]; b = [x.b] } would be f: 'a foo -> 'a list foo Cheers, Don