From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id A7D287EE4B for ; Fri, 27 Sep 2013 18:50:33 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of gdsfh1@gmail.com) identity=pra; client-ip=209.85.216.45; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gdsfh1@gmail.com"; x-sender="gdsfh1@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of gdsfh1@gmail.com designates 209.85.216.45 as permitted sender) identity=mailfrom; client-ip=209.85.216.45; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gdsfh1@gmail.com"; x-sender="gdsfh1@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-qa0-f45.google.com) identity=helo; client-ip=209.85.216.45; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gdsfh1@gmail.com"; x-sender="postmaster@mail-qa0-f45.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ai0CACW2RVLRVdgtnGdsb2JhbABbhBGDKb0igRUIFg4BAQEBAQYNCQkUKIIlAQEEASMdARseAwELBgULAwwCJgICIgERAQUBHAaIBgEDCQabQowBUYMKhAwKGScNZIkAAQUMgR2OL4JqgTYDiTOOTJAOGCmEUDk X-IPAS-Result: Ai0CACW2RVLRVdgtnGdsb2JhbABbhBGDKb0igRUIFg4BAQEBAQYNCQkUKIIlAQEEASMdARseAwELBgULAwwCJgICIgERAQUBHAaIBgEDCQabQowBUYMKhAwKGScNZIkAAQUMgR2OL4JqgTYDiTOOTJAOGCmEUDk X-IronPort-AV: E=Sophos;i="4.90,994,1371074400"; d="scan'208";a="34658721" Received: from mail-qa0-f45.google.com ([209.85.216.45]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 27 Sep 2013 18:50:32 +0200 Received: by mail-qa0-f45.google.com with SMTP id k4so639963qaq.4 for ; Fri, 27 Sep 2013 09:50:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=bRnGwCevOgI0mhM73E/acHCm8+bBSXnuZL7mY5KSwJ4=; b=wgdcB1BpOQVpYpzc+0/gPs0NrXHK/sdm70L5DJH1tMWOTR4Qb+CfVL3XHdVfxypD28 GPqR/8qtkrHpAjErqSh8Cl7RzsZFpO4UIDrSddxtrGy4fvlBmeMeOhVvB/nn5eh6c8nP FHLLJyn2Bllnzp0P5MlyEW6A/Ip/BFA+OE7ctu8/MhO3qFFpuyWr5aZXwNucgtUoQlwu Qd7QFIcFCBotWHDgVAaI9qealoKteY6QiTmY381r2PCsfiAj62i5oCsNIDRPRe52kRDO hYQB3UxLluePxwBLdM+0RL8/rgAbPtyx0E7/WBVQ0DIWVvhKs4OeuFERCholNEDEDtPE ggGw== MIME-Version: 1.0 X-Received: by 10.49.15.97 with SMTP id w1mr10347404qec.13.1380300632015; Fri, 27 Sep 2013 09:50:32 -0700 (PDT) Received: by 10.49.42.70 with HTTP; Fri, 27 Sep 2013 09:50:31 -0700 (PDT) In-Reply-To: References: Date: Fri, 27 Sep 2013 19:50:31 +0300 Message-ID: From: Dmitry Grebeniuk To: Anthony Tavener Content-Type: text/plain; charset=UTF-8 Subject: Re: [Caml-list] Proposal: re-design of ocaml headers 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".