Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: blue storm <bluestorm.dylc@gmail.com>
To: caml-list List <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] Annotated trees
Date: Mon, 7 Jun 2010 14:01:38 +0200	[thread overview]
Message-ID: <AANLkTil5WK6RKiBpRSTKtKehI0H8To8k8cA81BAar-fE@mail.gmail.com> (raw)
In-Reply-To: <AANLkTik0iDx-OGUSKw3ZCU-hV8OvWKH_HEndA85nube3@mail.gmail.com>

On Mon, Jun 7, 2010 at 11:22 AM, Daniel Bünzli
<daniel.buenzli@erratique.ch> wrote:
> That's true and certainly a good argument for the second form if you
> already know the type of your annotations and have such needs. However
> if you want to keep that polymorphic (the annotation is a convenience
> for the client) it results in a type variable per case which becomes
> heavy.

You probably know that already but there is a nice use of object types
as "type-level records" that make that kind of "lots of type
variables" situations tractable :

type 'annot tree =
 | Leaf of 'leaf_annot * string
 | Node of 'node_annot * 'annot tree list
constraint 'annot =
 < leaf : 'leaf_annot;
   node : 'node_annot >


  reply	other threads:[~2010-06-07 12:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-06 15:26 Daniel Bünzli
2010-06-07  5:09 ` [Caml-list] " Martin Jambon
2010-06-07  5:15   ` Martin Jambon
2010-06-07  9:22   ` Daniel Bünzli
2010-06-07 12:01     ` blue storm [this message]
2010-06-07  6:45 ` Jacques Garrigue

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=AANLkTil5WK6RKiBpRSTKtKehI0H8To8k8cA81BAar-fE@mail.gmail.com \
    --to=bluestorm.dylc@gmail.com \
    --cc=caml-list@yquem.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