data Tree a = Leaf a | Branch ( Tree a ) ( Tree a )
leaves :: Tree a -> Int leaves t = case t of Leaf k -> 1 Branch l r -> leaves l + leaves r