Skip to content
Skillpedia
General coding48k · #4644

fp-pipe-ref

What it does

These tools help organize a sequence of actions in your code. `pipe` applies a series of transformations to a value at once. `flow` creates a new function that combines multiple transformations to be used later.

When to use it

  • ✓When you need to apply multiple processing steps to data.
  • ✓To create a reusable function that processes data in a specific way.
  • ✓When working with libraries that organize functions into sequences.

Skill link

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/fp-pipe-ref/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/fp-pipe-ref/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“How do I transform a string by removing extra spaces, making it uppercase, and then splitting it into words?”

5 new skills a week. 1 minute to read.

How it works

The `pipe` function takes an initial value and passes it through a series of functions, one after another. The `flow` function combines several functions into a new one, which can then be used to process different values in the same way.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

pipe & flow Quick Reference

pipe - Transform a Value

import { pipe } from 'fp-ts/function'

// pipe(startValue, fn1, fn2, fn3)
// = fn3(fn2(fn1(startValue)))

const result = pipe(
  '  hello world  ',
  s => s.trim(),
  s => s.toUpperCase(),
  s => s.split(' ')
)
// ['HELLO', 'WORLD']

flow - Create Reusable Pipeline

import { flow } from 'fp-ts/function'

// flow(fn1, fn2, fn3) returns a new function
const process = flow(
  (s: string) => s.trim(),
  s => s.toUpperCase(),
  s => s.split(' ')
)

process('  hello world  ') // ['HELLO', 'WORLD']
process('  foo bar  ')     // ['FOO', 'BAR']

When to Use

Use When
pipe Transform a specific value now
flow Create reusable transformation

With fp-ts Types

import * as O from 'fp-ts/Option'
import * as A from 'fp-ts/Array'

// Option chain
pipe(
  O.fromNullable(user),
  O.flatMap(u => O.fromNullable(u.email)),
  O.getOrElse(() => 'no email')
)

// Array chain
pipe(
  users,
  A.filter(u => u.active),
  A.map(u => u.name)
)

Common Pattern

// Data last enables partial application
const getActiveNames = flow(
  A.filter((u: User) => u.active),
  A.map(u => u.name)
)

// Reuse anywhere
getActiveNames(users1)
getActiveNames(users2)

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

Reference scope

These are fp-ts 2.x fragments. Supply application variables, types, validators and imports, and check the installed version. map does not catch thrown exceptions. Task has no typed error channel; an improperly wrapped promise can still reject. Use tryCatch at fallible boundaries.

Official API: fp-ts modules.

FAQ

What's the difference between `pipe` and `flow`?

`pipe` is for transforming a specific value now, applying functions in sequence. `flow` is for creating a new function that combines transformations, to be used multiple times later.

What are `pipe` and `flow` used for?

They help chain or compose functions, making code more readable and organized, especially when you have multiple processing steps.

Can I use this with any data type?

Yes, as long as the functions you use in `pipe` or `flow` are compatible with the data types being passed between them.

Details

Original description by the author

Quick reference for pipe and flow. Use when user needs to chain functions, compose operations, or build data pipelines in fp-ts.

repo: sickn33/agentic-awesome-skills

Popularity

GitHub stars
48k
Ranking position
#4644
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills