hello, I am struggling with rose trees
in Haskell. I need to construct an algebraic data type definition for
"family trees" and a representation of the tree below. Also I need to
construct a function that returns a persons children when given both a
family tree and a name. The same is needed but for a getParents
function. 

                                                    1

 

                                  2                 3               4

                           5     6     7                   8    9    10     11

 

That is the rose tree that I seek. Where each number above is equivalent to 
(String, String) 

 

Data Tree a = Empty | Leaf a | Node a [(Tree a)]

 

example :: Tree (String, String) 

example = Node ("a","b")     -- root node

                    [ ...............define tree.........................] -- 
end of tree


_________________________________________________________________
100’s of Music vouchers to be won with MSN Music
https://www.musicmashup.co.uk
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to