[Haskell-cafe] Rose Tree

Ryan Bloor ryanbloor at hotmail.com
Sat Nov 3 22:23:47 EDT 2007


Hello,
 
 
I need help... I am having trouble with rose trees.
 
                                                 1
 
                                  2             3           4
                           5     6     7               8    9    10     11
 
That is the rose tree that I seek. 
 
Data Tree a = Empty | Leaf a | Node a [(Tree a)]
 
example :: Tree (String, String) 
example = Node ("a","b")     -- root node
                    [ ........................................] -- end of tree
 
What I want to do is create two functions that return either the children or parents of a given input, here a String. 
 String -> Tree -> [String]         I think 
_________________________________________________________________
The next generation of MSN Hotmail has arrived - Windows Live Hotmail
http://www.newhotmail.co.uk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20071104/f04745ca/attachment-0001.htm


More information about the Haskell-Cafe mailing list