From: Andreas Rossberg <rossberg@mpi-sws.mpg.de>
To: skaller <skaller@users.sourceforge.net>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Re: How important are circular lists/recursive objects?
Date: Mon, 08 Oct 2007 11:57:13 +0200 [thread overview]
Message-ID: <4709FEF9.5020405@mpi-sws.mpg.de> (raw)
In-Reply-To: <1191536723.7771.20.camel@rosella.wigram>
skaller wrote:
>>> Note that stuff like:
>>>
>>> let rec x= (1,x)
>>>
>>> is not generally allowed: in functional terms it is ill-defined,
>>>
>> It is disallowed in OCaml because it has a cyclic type, not because it is
>> a cyclic value. Try with "ocaml -rectypes".
>>
>
> lists have cyclic types too, they're not disallowed!
>
Technically speaking they haven't, because conventional variant types
are nominal, not structural.
In any case, even OCaml without -rectypes allows some cyclic types (if
the cycle goes through an object or polymorphic variant type), but not
arbitrary ones. That is a pragmatic design decision to avoid too many
bogus examples to type-check.
- Andreas
next prev parent reply other threads:[~2007-10-08 9:57 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-02 23:55 Brian Hurt
2007-04-03 6:24 ` Gleb Alexeyev
2007-04-03 6:58 ` [Caml-list] " Ville-Pertti Keinonen
2007-04-03 7:00 ` Andrej Bauer
2007-04-03 12:09 ` Jon Harrop
2007-04-03 13:31 ` Bruno De Fraine
2007-04-04 23:28 ` Brian Hurt
2007-04-05 0:51 ` Jon Harrop
2007-04-03 12:49 ` Philippe Wang
2007-04-04 3:52 ` Stefan Monnier
2007-04-04 5:28 ` [Caml-list] " skaller
2007-10-04 17:48 ` Fabrice Marchant
2007-10-04 20:39 ` skaller
2007-10-04 21:36 ` rossberg
2007-10-04 22:25 ` skaller
2007-10-05 10:42 ` Dominique Martinet
2007-10-08 9:57 ` Andreas Rossberg [this message]
2007-04-04 8:45 ` 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=4709FEF9.5020405@mpi-sws.mpg.de \
--to=rossberg@mpi-sws.mpg.de \
--cc=caml-list@yquem.inria.fr \
--cc=skaller@users.sourceforge.net \
/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