You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

fp-ts-stream

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fp-ts-stream

A library providing async and sync streams for fp-ts.

0.1.11
latest
Source
npmnpm
Version published
Weekly downloads
373
19.17%
Maintainers
1
Weekly downloads
 
Created
Source

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:

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:

- Bitcoin     : bc1qtut2ss8udkr68p6k6axd0na6nhvngm5dqlyhtn
- Bitcoin Cash: qzmmv43ztae0tfsjx8zf4wwnq3uk6k7zzgcfr9jruk
- Ether       : 0xf542BED91d0218D9c195286e660da2275EF8eC84

Keywords

stream

FAQs

Package last updated on 03 Jun 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts