Completed
Details
Details
Assignee
David Nolen
David NolenReporter
Mike Fikes
Mike FikesLabels
Approval
Accepted
Patch
Code and Test
Affects versions
Priority

Created December 18, 2017 at 3:35 PM
Updated December 22, 2017 at 4:56 PM
Resolved December 22, 2017 at 4:56 PM
Have
iterate
,cycle
, andrepeat
return custom types that are directly reducible.Background and inspiration are and http://insideclojure.org/2015/01/18/reducible-generators/
While
(satisfies? IReduce (iterate inc 0))
returnstrue
this is viaLazySeq
, as opposed to, for example(satisfies? IReduce (range))
which involves a custom type.One motivation would be the ability to transduce over large generated collections without consuming memory (which otherwise occurs due to lack of locals clearing).
For example, the following uses very little memory:
where this semantically equivalent form consumes gigabytes:
It is expected that, to implement this ticket, three new types would be introduced, akin to the existing
Range
class, porting as much as possible from the existing types implemented in Clojure foriterate
,cycle
, andrepeat
.