Implement Foldable for Tree