Yields all items in the input array for as long as predicate returns true.
predicate yields arrays of [stop:boolean, acc:A]. The first value
is true when the iteration should stop, and the acc is the accumulated value.
This allows until to be used to carry over some state from item to item.
Yields all items in the input array for as long as
predicate
returns true.predicate
yields arrays of[stop:boolean, acc:A]
. The first value is true when the iteration should stop, and theacc
is the accumulated value. This allowsuntil
to be used to carry over some state from item to item.Example: Stop when we hit an item with value of 3
Example: Stop when we reach a total, using 0 as initial value
Param: data
Param: predicate
Returns