0.2.0 • Published 1 year ago
ts-lazy-lib v0.2.0
ts-lazy-lib
Реализация ленивых вычислений в typescript
Install
yarn add ts-lazy-lib # Or alternatively: `npm install ts-lazy-lib`
Usage
Пример использования
import { lazy, unlazy, take, range, foldr, map } from 'ts-lazy-lib'
...
const list = take(lazy(100000), range(lazy(10)));
const lazyValue = foldr((a, b) => a + ', ' + b, lazy('!'), map(v => String(v), list));
console.log(unlazy(lazyValue));
Будет выведено:
10, 11, ..., 100008, 100009, !
Testing
yarn test # Or alternatively: `npm test`
See Also
License
The MIT License. See the license file for details.