cgrand / xforms

Extra transducers and reducing fns for Clojure(script)
575 stars 32 forks source link

How to match reductions behavior #30

Closed SevereOverfl0w closed 5 years ago

SevereOverfl0w commented 5 years ago
(into [] (x/reductions +) [10 10 10]) ;; => [0 10 20 30]
(reductions + [10 10 10]) ;; => [10 20 30]

Am I missing some way to do this?

cgrand commented 5 years ago

It’s the same difference than between transduce and reduce when knit is omitted. Is it a blocker in a rewrite or an unexpected difference?

SevereOverfl0w commented 5 years ago

I can work around in my rewrite easily enough for my case without breaking my performance threshold, but caused me some bad data.

cgrand commented 5 years ago

Closing this issue as it's document in the docstring.