diff --git a/README.md b/README.md index faca4ab..9dad9bf 100644 --- a/README.md +++ b/README.md @@ -1417,18 +1417,47 @@ XXX should we support infinite generators as input? Create an _iterable promise_ ```bnf Promise.iter() - -> + -> ``` #### `.map(..)` / `.filter(..)` / `.reduce(..)` +```bnf +.map() + -> + +.filter() + -> + +() +``` + +```bnf +.reduce(, ) + -> + +(, ) +``` + +Note that these are different to `Array`'s equivalents in some details: +- `` is _not_ called in the order of element occurrence but rather + in the order of elements are resolved/ready. +- `` does not get either the element _index_ or the _container_. + this is because the index with _out-of-order_ and _depth-first_ execution the + index is unknowable and the container is a promise/black-box. + #### `.flat(..)` - +```bnf +.flat() +.flat() + -> +``` +This is similar to [`.flat(..)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat) see it for more info. #### `.then(..)` / `.catch(..)` / `.finally(..)`