fp-ts-iterable
TypeScript icon, indicating that this package has built-in type declarations

4.2.6 • Public • Published

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

# npm
npm install fp-ts-iterable

# yarn
yarn add fp-ts-iterable

# pnpm
pnpm add fp-ts-iterable

Documentation

Please visit the documentation 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<A> is Iterable<Promise<A>>, but should be coerced to Iterable<Task<A>> via FromAsyncIterable

Readme

Keywords

none

Package Sidebar

Install

npm i fp-ts-iterable

Weekly Downloads

2

Version

4.2.6

License

none

Unpacked Size

2.49 kB

Total Files

2

Last publish

Collaborators

  • waynevanson