From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id A5EEABC57 for ; Mon, 7 Jun 2010 14:01:39 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AigDAJZ8DExKfVI0mGdsb2JhbACePAgVAQEBAQEICQwHESKtPoIBhQIuiE8BAQMFhRIE X-IronPort-AV: E=Sophos;i="4.53,378,1272837600"; d="scan'208";a="64103765" Received: from mail-ww0-f52.google.com ([74.125.82.52]) by mail4-smtp-sop.national.inria.fr with ESMTP; 07 Jun 2010 14:01:39 +0200 Received: by wwb31 with SMTP id 31so2659258wwb.39 for ; Mon, 07 Jun 2010 05:01:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=Ji2sqbQhDlHlXQ47k/0d5RS+qlr6OgaohPMkOTGMwDU=; b=x+tX1DZzhahosaVU7tpp1VocFgooIk0zGOR6mSpIWUib9XkSmuF51UQotHZMaAwfn7 uStM8ZG5xMO/YjrdadBaWcInlakcKCjEgeyhve4Rsr2raU6IAKCthapvzV+JILxmetuT 3wrORSZeWH6LCZZnmXGN6Jum1inxvkmmVbI0o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=e88xJhG6S9zNr6KGiTZyT9DxvXd7iq3nZEc92vmIxv11f5M9s0apazdmep3NmYYrnB tq4N45jbsG1JonkZF+8wlchPaaCj1YtL6bHFjEmp/LyBciWWJqTaEl1oawTJ7XMrKHGR 024kclSh2aJpGydW5TC6PZhMTt8ep7X7l51eE= MIME-Version: 1.0 Received: by 10.227.128.199 with SMTP id l7mr13508308wbs.210.1275912098960; Mon, 07 Jun 2010 05:01:38 -0700 (PDT) Received: by 10.216.46.199 with HTTP; Mon, 7 Jun 2010 05:01:38 -0700 (PDT) In-Reply-To: References: <4C0C7F08.3010403@ens-lyon.org> Date: Mon, 7 Jun 2010 14:01:38 +0200 Message-ID: Subject: Re: [Caml-list] Annotated trees From: blue storm To: caml-list List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; bunzli:01 buenzli:01 annotations:01 node:01 node:01 storm:98 polymorphic:01 wrote:01 caml-list:01 constraint:01 argument:02 tree:02 tree:02 annotated:02 annotation:02 On Mon, Jun 7, 2010 at 11:22 AM, Daniel B=FCnzli 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 =3D | Leaf of 'leaf_annot * string | Node of 'node_annot * 'annot tree list constraint 'annot =3D < leaf : 'leaf_annot; node : 'node_annot >