partition-all is documented to produce list partitions, but the transducer arity produces vector partitions. There’s already an issue about this from 2018: https://ask.clojure.org/index.php/3830/partition-docstring-should-mention-returns-vectors-transducer By now this it’s probably too late to change the behaviour, so I think it should be documented that the transducer arity produces vectors.
IMO there is a case to be made that the issue here is that the transducer arity isn't documented well enough.
this was an intentional choice (we carried it into the new partitionv-all)
so not planning to change the behavior, but updating the doc makes sense
still, it is a bit of a strange behavior.
(->> xs (partition-all 2) (mapv #(conj % y)))
for instance doesn't convert well into transducers, requiring a seq to avoid the vector's conj behavior.
(into [] (comp (partition-all 2)
(map #(conj (seq %) y)))
xs) so you want to put on the front?
use cons?
(into [] (comp (partition-all 2) (map #(cons y %))) xs)yes I know -in fact, I'd probably cons from the beginning given that it communicates I'm working with a seq abstracton - just digging for a case where this makes a difference
given that this was added 9 years ago and I'm not aware of anyone else filing an issue about it, I don't think it's too common