Hi Chad,
I think this idea is better than what I had suggested, but as it stands it doesn't typecheck. Did you mean something like this?
Yep, just the type signature was wrong :)
leaves :: Tree -> [Int]
leaves = f []
where
f rest (Leaf n) = n : rest
f rest (Branch l r) = f (f rest r) l
Thanks Neil _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
