<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Example understood. Thanks.<br><br>Is there a module for binary trees?<br><br>Michael<br><br>--- On <b>Wed, 6/10/09, wren ng thornton <i>&lt;wren@freegeek.org&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: wren ng thornton &lt;wren@freegeek.org&gt;<br>Subject: Re: [Haskell-cafe] Building a tree?<br>To: haskell-cafe@haskell.org<br>Date: Wednesday, June 10, 2009, 8:13 PM<br><br><div class="plainMail">michael rice wrote:<br>&gt; Here's a function from Data.Tree:<br>&gt; <br>&gt; unfoldTree :: (b -&gt; (a, [b])) -&gt; b -&gt; Tree a<br>&gt; Build a tree from a seed value<br>&gt; <br>&gt; Could someone please give me a brief example of usage.<br><br>&nbsp; &nbsp; Data.Tree&gt; let t = unfoldTree (\i -&gt; (show i, [i`div`2..i-1]))<br>&nbsp; &nbsp; Data.Tree&gt; putStr . drawTree $ t
 8<br><br>-- Live well,<br>~wren<br>_______________________________________________<br>Haskell-Cafe mailing list<br><a ymailto="mailto:Haskell-Cafe@haskell.org" href="/mc/compose?to=Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br><a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br></div></blockquote></td></tr></table><br>