add Foldable and Traversable instances