caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Don Syme <dsyme@microsoft.com>
To: caml-list@inria.fr
Subject: Record typing question
Date: Fri, 29 Oct 1999 06:25:21 -0700	[thread overview]
Message-ID: <39ADCF833E74D111A2D700805F1951EF1801426B@RED-MSG-06> (raw)


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






             reply	other threads:[~1999-10-29 17:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-10-29 13:25 Don Syme [this message]
1999-10-29 17:44 ` William Chesters
1999-11-04 14:30 Don Syme

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=39ADCF833E74D111A2D700805F1951EF1801426B@RED-MSG-06 \
    --to=dsyme@microsoft.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).