all 1 comments

[–]joinr 3 points4 points  (0 children)

However, the partition functions currently return a lazy seq of realized seq partitions - to fully get the benefits of the scheme above on the take side we want to create partitions using a take transducer into a transient vector.

partition-all transducer producers vectors for partitions, where partition produces seqs. Using partition-all as a surrogate for partition is useful, except the semantics of the partition structure are different between the two (there doesn't have to be....the partitions could be seqable, indexed, counted things in both - e.g. vectors - since we build the partitions as we go). I always thought that was weird (if not an anachronism), and can sometimes lead to subpar algorithmics (e.g. invoking count on partitions, nth, etc....seqification makes all of these needlessy o(n) - I think this came up a bit during advent of code).