fp-pipe-ref

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

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "fp-pipe-ref" with this command: npx skills add sickn33/antigravity-awesome-skills/sickn33-antigravity-awesome-skills-fp-pipe-ref

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

UseWhen
pipeTransform a specific value now
flowCreate 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.map(u => 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)

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Web3

blockchain-developer

No summary provided by upstream source.

Repository SourceNeeds Review
Web3

llm-application-dev-langchain-agent

No summary provided by upstream source.

Repository SourceNeeds Review
Web3

langchain-architecture

No summary provided by upstream source.

Repository SourceNeeds Review