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 79BBFBC57 for ; Sun, 6 Jun 2010 17:26:25 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtkBAF9bC0zRVdvckWdsb2JhbACDHZskCBUBAQEBCQsKBxEDH61kgjqELIh9AQEDBYEhgwNuBI4N X-IronPort-AV: E=Sophos;i="4.53,372,1272837600"; d="scan'208";a="64068642" Received: from mail-ew0-f220.google.com ([209.85.219.220]) by mail4-smtp-sop.national.inria.fr with ESMTP; 06 Jun 2010 17:26:25 +0200 Received: by ewy20 with SMTP id 20so473032ewy.3 for ; Sun, 06 Jun 2010 08:26:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=dCDaOGiE00vF4zzIjBJvH9Ct6MEsv6nyM8XODZbACEQ=; b=J3X8A1XQoCxyWBZfWbLVmFYLnWqXs5tFHRdN0ceaSw9BMe7pNVgfV21vObbJ57/h65 Ri4+r2EuUapDgQ/uQTtY4xBT9G74blPZJxpADef/2kRbWJlhzAhtTO1sy8/6prws2z2A cXFIS1KCkGiqm03sjd+YljwfpcJRqQwyOsc8M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=vuKGWZ5jC0nYb9pcZJcxwGXlMzD76BEUAEe3DKTfrgSeMvE0VygTr09rky+5AfFh1B it39bMil828yo1qLvQ0BzqFjAgdZ9mIEjfLHYB2rR6+T9HRVH/AdMfRUYV2gPtP6vNW0 yCCfPfhp0nFYiqAAo1aEaVVRI9oJKDX+cd5rA= MIME-Version: 1.0 Received: by 10.213.113.193 with SMTP id b1mr310184ebq.13.1275837984520; Sun, 06 Jun 2010 08:26:24 -0700 (PDT) Sender: daniel.c.buenzli@gmail.com Received: by 10.213.20.19 with HTTP; Sun, 6 Jun 2010 08:26:24 -0700 (PDT) Date: Sun, 6 Jun 2010 17:26:24 +0200 X-Google-Sender-Auth: WWqyepgLwVNx8ON32KR0DKV4Z10 Message-ID: Subject: Annotated trees From: =?UTF-8?Q?Daniel_B=C3=BCnzli?= To: caml-list List Content-Type: text/plain; charset=UTF-8 X-Spam: no; 0.00; buenzli:01 annotations:01 node:01 node:01 readable:01 tree:02 match:02 annotated:02 string:02 string:02 pattern:04 daniel:04 daniel:04 anybody:07 leaf:07 Hello, Does anybody have any real world experience in choosing between the following two representations for a tree augmented with annotations ? type 'a t = 'a * [ `Leaf of string | `Node of 'a t list ] type 'a t = [ `Leaf of 'a * string | `Node of 'a * 'a t list ] Which one is more convenient to process, pattern match on, makes code more readable etc. ? Thanks in advance, Daniel