I'm defining my tree as:
data Tree a = Nulo
| No a (Tree a) (Tree a)
deriving (Eq, Ord, Read, Show)
Filling in the tree
tree1 :: Tree Int
tree1 = No 1 Nulo (No 2 Nulo(No 3 Nulo Nulo))
FoldTree function
foldTree :: (b -> b -> b) -> Tree a -> b
foldTree f Nulo = 0
foldTree f (No a e d) = f (foldTree f e)(foldTree f d)
And finally the functions somaTree and sumTree with folding
somaTree :: Tree a -> Int
somaTree Nulo = 0
somaTree (No a e d) =
somaTreeFold :: Tree a -> Int