Welcome! Please see the About page for a little more info on how this works.

+2 votes
in Transducers by

Reductions does not currently provide a transducer when called with a 1-arity.

Proposed:

  • A reductions transducer with explicit initialization values: reductions-with
  • Do to arity conflicts, this is a separate function, not combined with reductions

A second patch proposes a variant which allows explicit initialization values: reductions-with

(assert (= (sequence (reductions-with + 0) [1 2 3 4 5]) [1 3 6 10 15])))

Patch: 0003-add-reductions-with.patch

Prescreened by: Alex Miller

16 Answers

0 votes
by
...