Creates a generator by recursively applying a function to generate the next value. Continues until the done predicate function returns true.
Element type
Function that computes the next value based on current value and index
Initial value
Optional predicate function that determines when to stop (default: never stop)
Values produced by repeatedly applying the next function
G.pipe( G.recursive(n => n * 2, 1, (n) => n > 16), G.array) // [1, 2, 4, 8, 16] Copy
G.pipe( G.recursive(n => n * 2, 1, (n) => n > 16), G.array) // [1, 2, 4, 8, 16]
Creates a generator by recursively applying a function to generate the next value. Continues until the done predicate function returns true.