From: Xavier Leroy <Xavier.Leroy@inria.fr>
To: Don Syme <dsyme@microsoft.com>, caml-list@inria.fr
Subject: Re: Boxing wrt. unary constructors
Date: Thu, 15 Oct 1998 19:25:27 +0200 [thread overview]
Message-ID: <19981015192527.04035@pauillac.inria.fr> (raw)
In-Reply-To: <39ADCF833E74D111A2D700805F1951EF0B2EF53D@RED-MSG-06>; from Don Syme on Wed, Oct 14, 1998 at 02:43:31AM -0700
> This is probably a FAQ, but if I have a type
> type abc = ABC of int
> then does Ocaml 2.00 use a boxed or unboxed repr. of values of this
> type?
Boxed. While it would not be hard to make a special case for
one-constructor datatypes, this is not currently done in the OCaml
compiler. However, you can use type abstraction to obtain much of the
same effects while keeping an unboxed representation:
(struct type abc = int let abc x = x let proj_abs x = x end :
sig type abc val abc: int->abc val proj_abc: abc->int end)
Regards,
- Xavier Leroy
prev parent reply other threads:[~1998-10-16 11:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-10-14 9:43 Don Syme
1998-10-15 17:25 ` Xavier Leroy [this message]
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=19981015192527.04035@pauillac.inria.fr \
--to=xavier.leroy@inria.fr \
--cc=caml-list@inria.fr \
--cc=dsyme@microsoft.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