ts-lazy-lib
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

ts-lazy-lib

CI Status npm License

Реализация ленивых вычислений в 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.

Readme

Keywords

Package Sidebar

Install

npm i ts-lazy-lib

Weekly Downloads

7

Version

0.2.0

License

MIT

Unpacked Size

23.1 kB

Total Files

11

Last publish

Collaborators

  • gadpetrovich