I\'m going through the problems in the Haskell O\'Reilly book. The problem I am working on is
Using the binary tree type that we defined earlier in this chapter
You pattern-match against constructors, i.e. the cases, of your Tree ADT. Tree is just what sums them all up.
Tree
It's much more straightforward like this, and, most of all, correct:
height Empty = 0 height (Node _ l r) = 1 + max (height l) (height r)