Version française
Home     About     Download     Resources     Contact us    
Browse thread
Annotated trees
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Daniel_Bünzli <daniel.buenzli@e...>
Subject: Annotated trees
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