본문으로 건너뛰기
Skillpedia
일반 코딩48k · #4644

fp-pipe-ref

하는 일

이 도구는 코드에서 일련의 작업을 정리하도록 돕습니다. `pipe`는 값 하나에 여러 변환을 한 번에 적용합니다. `flow`는 여러 변환을 결합한 새 함수를 만들어 나중에 사용할 수 있게 합니다.

사용하는 경우

  • ✓데이터에 여러 처리 단계를 적용해야 할 때.
  • ✓특정 방식으로 데이터를 처리하는 재사용 가능한 함수를 만들 때.
  • ✓함수를 순서대로 묶는 라이브러리와 작업할 때.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

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.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“문자열에서 불필요한 공백을 제거하고, 대문자로 바꾼 다음, 단어로 나누려면 어떻게 하나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

`pipe` 함수는 초기 값을 받아 함수들을 하나씩 차례로 통과시킵니다. `flow` 함수는 여러 함수를 하나의 새 함수로 결합해, 나중에 다른 값에도 같은 방식으로 처리할 수 있게 합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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.

자주 묻는 질문

`pipe`와 `flow`의 차이는 무엇인가요?

`pipe`는 지금 특정 값에 함수들을 순서대로 적용할 때 씁니다. `flow`는 여러 번 나중에 사용할 변환을 결합한 새 함수를 만들 때 씁니다.

`pipe`와 `flow`는 무엇에 쓰나요?

함수를 연결하거나 결합하도록 도와서, 특히 처리 단계가 많을 때 코드를 더 읽기 쉽고 체계적으로 만듭니다.

어떤 데이터 타입과도 쓸 수 있나요?

네, `pipe`나 `flow`에서 사용하는 함수들이 서로 주고받는 데이터 타입과 호환되는 한 가능합니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
48k
순위
#4644
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬