
2 Jun
2020
2 Jun
'20
11:47 p.m.
Isn't the order of elements when you use a Traversable also arbitrary,
since trees have depth-first and breadth-first traversals?
Joseph C. Sible
On Tue, Jun 2, 2020 at 9:39 AM Andreas Abel
I think bitraverse makes some sense. If you have a tree with two kinds of leaves, you can effectfully map over it.
bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> t a b -> f (t c d)
Here, the tree structure stays in place.
However, bifolding is less meaningful because the ordering of elements in the resulting collection (monoid) is somewhat arbitrary. This argument has already been raised in this thread.