purescript-catenable-lists
purescript-catenable-lists copied to clipboard
CatQueue `traverse` implementation
The traverse implementation of CatQueue iterates through every element twice.
Is this intended?
https://github.com/purescript/purescript-catenable-lists/blob/09abe1f4888bc00841ad2b59e56a9e7ce7ebd4ab/src/Data/CatQueue.purs#L166-L168
I would imagine it's to preserve the order since foldl will reorder it (and foldl is being used because it makes the traversal stack safe), although maybe cons could be used instead to avoid the double pass. I'm not sure if there should be a preference for it to generally be cons or snoc constructed, it probably depends on the operations being run on it.