caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Dmitry Grebeniuk <gdsfh1@gmail.com>
To: Anthony Tavener <caml-list@inria.fr>
Subject: Re: [Caml-list] Proposal: re-design of ocaml headers
Date: Fri, 27 Sep 2013 19:50:31 +0300	[thread overview]
Message-ID: <CAPi0vKV6BU4xkinP2fnDiWV8PL+cOU35ih+LPzi1mOjG7J=Vtw@mail.gmail.com> (raw)
In-Reply-To: <CAN=ouMRpbwSZqi_b07TKRFvUSZNxtanM=J4+iws_d8m6LDFt3Q@mail.gmail.com>

Hello.

  (first, personal: nice to see someone developing games in OCaml!
Wish you good profit here.  Btw, I'd like to see an announcement of
your game here.)

> 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.

  Things I can think of:

- Are these characteristics "flat", ungroupped, without any common
logic like "health-affecting", "strength-affecting"?  Maybe it would
be nice (w.r.t. the logic) to group them?

- Sum types should be matched fully, each constructor should be
present in "match .. with".  That's a point of sum types and
guarantees about them (there's a warning about it in the compiler,
great thing).  I doubt you usually have such heavy matches.  So if you
don't make use of such kind of guarantees, you can use even exceptions
to encode characteristics.  (polymorphic variants are fine too, of
course.)

> I wanted to share that as a "be careful of what seems impossible from your
> perspective". ;)

  Got it.  But any language has some limits of what can one achieve
with it "out of box and using common ways".  There are other ways to
make things work.  So one of my mottos is "keep caml and curry on".

  parent reply	other threads:[~2013-09-27 16:50 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
2013-09-27 16:50     ` Dmitry Grebeniuk [this message]
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='CAPi0vKV6BU4xkinP2fnDiWV8PL+cOU35ih+LPzi1mOjG7J=Vtw@mail.gmail.com' \
    --to=gdsfh1@gmail.com \
    --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).