From: Angelo Corsaro <angelo@icorsaro.net>
To: caml-list@inria.fr
Subject: [Caml-list] Recursive record initialisation
Date: Mon, 16 Apr 2018 22:57:11 +0200 [thread overview]
Message-ID: <A3ACD6F4-5EA8-49C4-9BB7-7C4445F3EB2D@icorsaro.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 899 bytes --]
Hello,
I have a question concerning the initialisation of mutually recursive record types. As a trivial example consider the following type declaration:
type atype = { b : btype; }
and btype = { a : atype; }
This is a legal type declaration (it type-checks w/o a blink), but I can’t see how such a type would be initialised? As both “a" and “b” are values there is an apparent bootstrapping issue. But as this is a legal type declaration I guess there is a way around, wondering what the right way is.
Thanks very much in advance for any clarification.
—Angelo
—
“Simplicity is the ultimate sophistication." ~ Leonardo da Vinci
--
Caml-list mailing list. Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs
[-- Attachment #2: Type: text/html, Size: 2047 bytes --]
next reply other threads:[~2018-04-16 20:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-16 20:57 Angelo Corsaro [this message]
2018-04-16 21:07 ` Gabriel Scherer
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=A3ACD6F4-5EA8-49C4-9BB7-7C4445F3EB2D@icorsaro.net \
--to=angelo@icorsaro.net \
--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).