From: Alain Frisch <alain@frisch.fr>
To: Philippe Veber <philippe.veber@gmail.com>
Cc: Dario Teixeira <darioteixeira@yahoo.com>, caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Emulating width subtyping with 1st-class modules
Date: Thu, 05 Aug 2010 18:17:25 +0200 [thread overview]
Message-ID: <4C5AE415.8070604@frisch.fr> (raw)
In-Reply-To: <AANLkTimezHJhnwKaUgJ6VyvEc2qSnYXRtRncV-6iuoTB@mail.gmail.com>
On 08/05/2010 06:10 PM, Philippe Veber wrote:
> I have a related question: the only reason why i'm not fully happy with
> objects used as anonymous records is that i sometimes use them as mere
> data containers and need to save (marshal) them at some point. Which is
> not permitted as soon as you want to exchange marshalled values between
> two different programs. Hopefully one can rely on json-static to cope
> with that limitation in a quite elegant way. Are first-class modules
> distinct in that respect ? That is, can they be marshalled if they do
> not contain closures ?
Yes, they can be marshaled. As usual with marshaling, you don't get any
type safety.
That said, first-class modules cannot really be used to simulate
anonymous records since they rely on nominal typing: even if S and S'
refer to identical signatures, the types (module S) and (module S') are
not equal.
Alain
next prev parent reply other threads:[~2010-08-05 16:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-05 15:02 Dario Teixeira
2010-08-05 16:10 ` [Caml-list] " Philippe Veber
2010-08-05 16:17 ` Alain Frisch [this message]
2010-08-05 16:35 ` Alain Frisch
2010-08-05 19:02 ` Dario Teixeira
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=4C5AE415.8070604@frisch.fr \
--to=alain@frisch.fr \
--cc=caml-list@yquem.inria.fr \
--cc=darioteixeira@yahoo.com \
--cc=philippe.veber@gmail.com \
/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