Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/incetarik/fp-ts-stream
Providing Transducers/Streams based on fp-ts library.
https://github.com/incetarik/fp-ts-stream
fp-ts functional-programming generators streaming
Last synced: 15 days ago
JSON representation
Providing Transducers/Streams based on fp-ts library.
- Host: GitHub
- URL: https://github.com/incetarik/fp-ts-stream
- Owner: incetarik
- License: mpl-2.0
- Created: 2022-10-20T15:21:59.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-03T21:41:24.000Z (over 1 year ago)
- Last Synced: 2024-11-17T15:22:00.497Z (26 days ago)
- Topics: fp-ts, functional-programming, generators, streaming
- Language: TypeScript
- Homepage:
- Size: 389 KB
- Stars: 30
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ccamel - incetarik/fp-ts-stream - Providing Transducers/Streams based on fp-ts library. (TypeScript)
README
# Streams for `fp-ts`
This library provides `Stream` and `AsyncStream` type classes which uses
`Generator` and `AsyncGenerator` internally, therefore enabling the developers
to have _transducers_, that are executed as much as they are used. See the
following example:```ts
import { range, filter, map, take, toArray } from 'fp-ts-stream/Stream'
import { pipe } from 'fp-ts/lib/function'// The following will only run/execute the `range` iterator only 4 times.
//
// No array will be allocated, until `toArray` and the rest of the iteration
// will be skipped/not completed.
pipe(
range(0, 10000), // iterates 4 times
filter(it => it % 2 == 1), // iterates 2 times
map(it => it * 3), // ...
take(2), // ...
toArray, // executed once
console.log
)```
The `Stream` is implementing all the functions that an array would normally
have, therefore the instances of it admit implementations such as `Traversable`,
`Chain` and etc.---
# Support
To support the project, you can send donations to following addresses:```md
- Bitcoin : bc1qtut2ss8udkr68p6k6axd0na6nhvngm5dqlyhtn
- Bitcoin Cash: qzmmv43ztae0tfsjx8zf4wwnq3uk6k7zzgcfr9jruk
- Ether : 0xf542BED91d0218D9c195286e660da2275EF8eC84
```