I'm just picking up Haskell and have a few questions about tree notation
First, I'm dealing with the following definition of a tree:
data Tree a = Leaf a | Branch [Tree a]
1) I understand that this definition allows for an infinite number of substrees. But what does the "a" beside the Tree mean? I think it means this Tree can be any data type, correct?
2) How does one define a Tree to test a function in Haskell? For example if I were to pass an array to a function, I would have Foo [1,2,3]. What would it look like for the tree definition above?
3) How would I find the sum of a simple tree (with the tree definition above)?
Thanks for your help in advance!