From: Don Syme <dsyme@microsoft.com>
To: "'William Chesters'" <williamc@dai.ed.ac.uk>
Cc: caml-redistribution@pauillac.inria.fr
Subject: RE: Record typing question
Date: Thu, 4 Nov 1999 06:30:26 -0800 [thread overview]
Message-ID: <39ADCF833E74D111A2D700805F1951EF18014278@RED-MSG-06> (raw)
>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
next reply other threads:[~1999-11-04 17:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-11-04 14:30 Don Syme [this message]
-- strict thread matches above, loose matches on Subject: below --
1999-10-29 13:25 Don Syme
1999-10-29 17:44 ` William Chesters
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=39ADCF833E74D111A2D700805F1951EF18014278@RED-MSG-06 \
--to=dsyme@microsoft.com \
--cc=caml-redistribution@pauillac.inria.fr \
--cc=williamc@dai.ed.ac.uk \
/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).