From: Don Syme <dsyme@microsoft.com>
To: "'Anton Moscal'" <msk@post.tepkom.ru>,
Christopher Jeris <cjeris@math.mit.edu>
Cc: caml-list@inria.fr
Subject: RE: anonymous record types in variants
Date: Tue, 16 Feb 1999 09:40:02 -0800 [thread overview]
Message-ID: <39ADCF833E74D111A2D700805F1951EF0F00B9C5@RED-MSG-06> (raw)
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
>
next reply other threads:[~1999-02-16 19:05 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-02-16 17:40 Don Syme [this message]
-- strict thread matches above, loose matches on Subject: below --
1999-02-22 16:37 Manuel Fahndrich
1999-02-22 17:56 ` Pierre Weis
1999-02-18 14:03 Don Syme
1999-02-18 10:13 Frank A. Christoph
1999-02-15 18:03 Manuel Fahndrich
1999-02-15 10:30 Don Syme
1999-02-12 20:53 Christopher Jeris
1999-02-16 10:57 ` Anton Moscal
1999-02-17 9:32 ` Xavier Leroy
1999-02-17 18:09 ` Christopher Jeris
1999-02-17 19:14 ` Didier Remy
1999-02-22 8:44 ` Anton Moscal
1999-02-22 13:00 ` Pierre Weis
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=39ADCF833E74D111A2D700805F1951EF0F00B9C5@RED-MSG-06 \
--to=dsyme@microsoft.com \
--cc=caml-list@inria.fr \
--cc=cjeris@math.mit.edu \
--cc=msk@post.tepkom.ru \
/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