haskell / containers

Assorted concrete container types
https://hackage.haskell.org/package/containers
315 stars 178 forks source link

Export something like splitTraverseSeq #87

Open treeowl opened 9 years ago

treeowl commented 9 years ago

I'm currently using it to implement enumFromTo-like functions for Seq, which demonstrate the same sort of performance advantage for incremental use as my proposed zipWith change. splitTraverseSeq would also be great for conversion from Array and Vector types. As it appears to be generally useful, I think we should export it in some form. We probably don't want to export a Splittable class, however, so we'll need to do something to work around that.

sjakobi commented 4 years ago

This issue hasn't seen any activity in a long time, and it's not clear to me what related work is being referenced.

@treeowl If this is still relevant, could you clarify what should be done? If the export is still desired, what type should it have?

treeowl commented 4 years ago

Unclear. Have you read the implementations of zipWith and chunksOf yet? The question is whether there's a reasonably clean and documentable way to package up something like the mechanism that underlies those.

treeowl commented 4 years ago

(If you haven't, well then, you might find them interesting. I actually came up with that mechanism as my first attempt to make <*> incremental. It turned out to be lousy for that purpose, but quite good for zipping. And it didn't take much to shoehorn chunksOf into that, though it's not the ideal shape for it.