https://github.com/waynevanson/fp-ts-iterable
Lazy list programming via Javascript Iterable interface
https://github.com/waynevanson/fp-ts-iterable
Last synced: about 1 month ago
JSON representation
Lazy list programming via Javascript Iterable interface
- Host: GitHub
- URL: https://github.com/waynevanson/fp-ts-iterable
- Owner: waynevanson
- Created: 2022-06-06T22:50:59.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-08-14T05:40:34.000Z (almost 3 years ago)
- Last Synced: 2025-04-24T04:46:31.306Z (about 1 month ago)
- Language: TypeScript
- Homepage: https://waynevanson.github.io/fp-ts-iterable
- Size: 220 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# fp-ts-iterable
fp-ts bindings for `Iterable` types, allowing for programming lazy and infinite lists.
This could (soon) be used as a drop in replacement for the module `fp-ts/ReadonlyArray`
## Installation
```sh
# npm
npm install fp-ts-iterable# yarn
yarn add fp-ts-iterable# pnpm
pnpm add fp-ts-iterable
```## Documentation
Please visit the [documentation](https://waynevanson.github.io/fp-ts-iterable/) for the API surface.
## Upcoming
- Structures
- `IterableTask` for interop with `AsyncIterator`
- `NonemptyIterable`
- `NonempyIterableTask`## Recommendations
### Coersion from types that are `Iterable`
- If coersing from something like a `ReadonlyArray`, it's recommended to coerce it to an `Iterable` using `FromReadonlyArray`.
- There is no performance benefit, but it could alleviate bugs before they happen.### `\*Right*` functions
- All functions using the word `Right` in their names require buffering all values so it knows where the end is.
- If the `Iterable` is large or infinite, it may cause an out of memory error.
Ensure infinite iterables end by using a skip combinator that does not contain the word `Right`.### `AsyncIterable` (Upcoming)
- `AsyncIterable` is `Iterable>`, but should be coerced to `Iterable>` via `FromAsyncIterable`