I\'m trying to figure out how to calculate the depth of a general tree in Haskell. I can figure out the solution for simple binary trees, but not for general trees with any numb
A few pointers:
Take a look at the map function which allows you to apply a function to each element in a list. In your case you want to apply depth
to each Tree a
in the list of children.
After you get that part you have to find the max depth in the list. Do a google search for "haskell max of list" and you'll find what you need.