From: Yotam Barnoy <yotambarnoy@gmail.com>
To: Anthony Tavener <anthony.tavener@gmail.com>
Cc: Dmitry Grebeniuk <gdsfh1@gmail.com>, Yotam Barnoy <caml-list@inria.fr>
Subject: Re: [Caml-list] Proposal: re-design of ocaml headers
Date: Fri, 27 Sep 2013 11:37:42 -0400 [thread overview]
Message-ID: <CAN6ygO=7wsXqD+g5X5nGH4fS3kb-tU9r4ZgA=85ESUSui8h3WA@mail.gmail.com> (raw)
In-Reply-To: <CAN=ouMRpbwSZqi_b07TKRFvUSZNxtanM=J4+iws_d8m6LDFt3Q@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1166 bytes --]
On Fri, Sep 27, 2013 at 11:31 AM, Anthony Tavener <anthony.tavener@gmail.com
> wrote:
>
> On Fri, Sep 27, 2013 at 9:08 AM, Dmitry Grebeniuk <gdsfh1@gmail.com>wrote:
>
>>
>> Why will anyone ever need more than 200 constructors of a sum type?
>> (also note the presence of polymorphic variant types.)
>>
>>
> Back when I read about the limit on constructors I had a moment of worry.
> Thankfully the limit is only on non-constant constructors.
>
> I currently have a variant with 292 constructors, but only 30 are
> non-constant.
> These represent optional characteristics a character may have in a game,
> some
> with additional payload. I could imagine all of them having their own
> payload,
> but of course there are other options, like polymorphic variants, or
> encoding these
> purely as data rather than types.
>
> I wanted to share that as a "be careful of what seems impossible from your
> perspective". ;)
>
Right. Constant constructors are represented as integers and require no
header, so they're very cheap. And polymorphic variants use more memory, so
they're not a great option. Having the flexibility for more constructors is
a good thing.
Yotam
[-- Attachment #2: Type: text/html, Size: 2041 bytes --]
next prev parent reply other threads:[~2013-09-27 15:38 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-27 14:05 Yotam Barnoy
2013-09-27 15:08 ` Dmitry Grebeniuk
[not found] ` <CAN6ygOmuCX6HLfSns0tXQCF3LWMANqhpnSN0vGWcNg0one2QzQ@mail.gmail.com>
2013-09-27 15:25 ` [Caml-list] Fwd: " Yotam Barnoy
2013-09-27 16:20 ` Dmitry Grebeniuk
2013-09-27 18:08 ` Yotam Barnoy
2013-09-27 18:12 ` Yotam Barnoy
2013-09-27 18:15 ` Paolo Donadeo
2013-09-27 18:41 ` Yotam Barnoy
2013-09-27 15:31 ` [Caml-list] " Anthony Tavener
2013-09-27 15:37 ` Yotam Barnoy [this message]
2013-09-27 16:50 ` Dmitry Grebeniuk
2013-09-30 14:48 ` Goswin von Brederlow
2013-09-30 15:31 ` Yotam Barnoy
2013-10-08 10:52 ` Goswin von Brederlow
2013-10-11 15:48 ` Yotam Barnoy
2014-01-30 20:53 ` Yotam Barnoy
2014-02-01 15:27 ` Goswin von Brederlow
2013-10-06 10:39 ` Florian Weimer
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='CAN6ygO=7wsXqD+g5X5nGH4fS3kb-tU9r4ZgA=85ESUSui8h3WA@mail.gmail.com' \
--to=yotambarnoy@gmail.com \
--cc=anthony.tavener@gmail.com \
--cc=caml-list@inria.fr \
--cc=gdsfh1@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;
as well as URLs for NNTP newsgroup(s).