https://github.com/attack-monkey/fpipe
fsharp style pipe for typescript
https://github.com/attack-monkey/fpipe
Last synced: 2 months ago
JSON representation
fsharp style pipe for typescript
- Host: GitHub
- URL: https://github.com/attack-monkey/fpipe
- Owner: attack-monkey
- Created: 2020-10-06T18:51:29.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-10-06T19:22:18.000Z (over 5 years ago)
- Last Synced: 2025-03-17T20:15:29.937Z (over 1 year ago)
- Language: TypeScript
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# fpipe
fsharp style pipe for typescript
An fsharp style pipe for typescript (default to arity 10)
## Install
```
npm i @attack-monkey/fpipe
```
## Usage
I like Ramda... but their `pipe` / `compose` is off for my liking.
Ramda `pipe` is essentially an fsharp `compose` and Ramda `compose` is just an fsharp right to left compose (`<<`).
`fpipe` is an fsharp pipe.
```typescript
const inc = (a: number) => a + 1
const thirteen = fpipe(10, inc, inc, inc)
```
^^ Which resembles
```fsharp
let thirteen = 10 |> inc |> inc |> inc
```