javascript-allonge-six icon indicating copy to clipboard operation
javascript-allonge-six copied to clipboard

Composing and Decomposing Data: Functional Iterators: unfolding and laziness

Open fugalfunkster opened this issue 9 years ago • 0 comments

The filterIteratorWith function on page 156 (pdf, 4/14/16) did not work for me. I believe the const declaration in the do block is the culprit. I got it to execute by making a let declaration for done and value before the do block:

 const filterIteratorWith = (fn, iterator) =>
    () => {
      let done, value;
      do {
        ({done, value} = iterator());
      } while (!done && !fn(value));
      return {done, value};
    }

fugalfunkster avatar Apr 16 '16 05:04 fugalfunkster