Record typing question

From: Don Syme (dsyme@microsoft.com)
Date: Fri Oct 29 1999 - 15:25:21 MET DST


From: Don Syme <dsyme@microsoft.com>
To: caml-list@inria.fr
Subject: Record typing question
Date: Fri, 29 Oct 1999 06:25:21 -0700

The typing rule for record overriding seems slightly more restrictive than
necessary, though I can imagine this is because it was simplest to implement
it this way. e.g.

# type 'a foo = { a: 'a; b: int };;
type 'a foo = { a: 'a; b:int }
# let f x = {x with a=1 };;
val f : int foo -> int foo = <fun>

Why doesn't f have type 'a foo -> int foo??

It's not a big deal, since I can always construct a whole new record term,
but there may be an easy fix. BTW adding record overriding in 2.02 has
saved me _heaps_ of time, and made it much more productive to use records.
Thanks!

Don



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:28 MET