import { default } from "https://deno.land/x/ramda@v0.27.2/source/reduceWhile.js";
Like reduce
, reduceWhile
returns a single item by iterating
through the list, successively calling the iterator function. reduceWhile
also takes a predicate that is evaluated before each step. If the predicate
returns false
, it "short-circuits" the iteration and returns the current
value of the accumulator.