fp-ts-pragmatic
하는 일
이 가이드는 TypeScript에서 fp-ts 라이브러리를 실용적으로 사용하는 법을 가르칩니다. 복잡한 개념에 빠지지 않고, 더 깔끔하고 유지 관리하기 쉬운 코드를 작성하는 데 가장 유용한 부분에 집중합니다.
사용하는 경우
- ✓fp-ts를 시작하고 간단한 예제가 필요할 때.
- ✓null일 수 있는 값, 오류, 비동기 작업을 다루는 TypeScript 코드를 작성할 때.
- ✓함수형 프로그래밍 이론을 전부 공부하지 않고 코드를 개선하고 싶을 때.
스킬 링크
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/fp-ts-pragmatic/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“fp-ts를 사용해 null일 수 있는 값을 TypeScript에서 간단하게 다루려면 어떻게 하나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
핵심 fp-ts 개념을 적용하는 패턴과 코드 예제를 보여 줍니다. 초점은 흔한 프로그래밍 문제를 직접 해결하는 데 있습니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Pragmatic Functional Programming
Read this first. This guide cuts through the academic jargon and shows you what actually matters. No category theory. No abstract nonsense. Just patterns that make your code better.
Detailed Guide
Read the detailed guide before executing this skill. It retains the complete procedure and reference material. Treat its safety, prerequisites, and validation requirements as mandatory. For focused work, load the relevant sections; for end-to-end work, read the guide completely.
When to Use This Skill
- When starting with fp-ts and need practical guidance
- When writing TypeScript code that handles nullable values, errors, or async operations
- When you want cleaner, more maintainable functional code without the academic overhead
- When refactoring imperative code to functional style
When NOT to Use FP
Functional programming is not always the answer. Here's when to keep it simple.
Simple Null Checks
// Just use optional chaining - it's built into the language
const city = user?.address?.city ?? 'Unknown'
// DON'T overcomplicate it
const city = pipe(
O.fromNullable(user),
O.flatMap(u => O.fromNullable(u.address)),
O.flatMap(a => O.fromNullable(a.city)),
O.getOrElse(() => 'Unknown')
)
Simple Loops
// A for loop is fine when you need early exit or complex logic
function findFirst(items: Item[], predicate: (i: Item) => boolean): Item | null {
for (const item of items) {
if (predicate(item)) return item
}
return null
}
// DON'T force FP when it doesn't help
const result = pipe(
items,
A.findFirst(predicate),
O.toNullable
)
Performance-Critical Code
// For hot paths, imperative is faster (no intermediate arrays)
function sumLarge(numbers: number[]): number {
let sum = 0
for (let i = 0; i < numbers.length; i++) {
sum += numbers[i]
}
return sum
}
// fp-ts creates intermediate structures
const sum = pipe(numbers, A.reduce(0, (acc, n) => acc + n))
When Your Team Doesn't Know FP
If you're the only one who can read the code, it's not good code.
// If your team knows this pattern
async function getUser(id: string): Promise<User | null> {
try {
const response = await fetch(`/api/users/${id}`)
if (!response.ok) return null
return await response.json()
} catch {
return null
}
}
// Don't force this on them
const getUser = (id: string): TE.TaskEither<Error, User> =>
pipe(
TE.tryCatch(() => fetch(`/api/users/${id}`), E.toError),
TE.flatMap(r => r.ok ? TE.right(r) : TE.left(new Error('Not found'))),
TE.flatMap(r => TE.tryCatch(() => r.json(), E.toError))
)
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.
자주 묻는 질문
fp-ts란 무엇인가요?
함수형 프로그래밍 원칙을 사용해 코드를 더 안전하고 체계적으로 작성하도록 돕는 TypeScript 라이브러리입니다.
언제 fp-ts를 쓰지 말아야 하나요?
기본적인 null 검사, 단순한 반복문, 최대 성능이 필요한 코드, 또는 팀이 함수형 프로그래밍에 익숙하지 않을 때처럼 매우 간단한 작업에는 쓰지 마세요.
fp-ts 전체 문서를 읽어야 하나요?
아닙니다. 이 가이드는 학술적인 복잡함 없이 빠르게 결과를 얻도록 가장 중요한 20%(80/20 방식)에 집중합니다.
상세 정보
작성자의 원본 설명
A practical, jargon-free guide to fp-ts functional programming - the 80/20 approach that gets results without the academic overhead. Use when writing TypeScript with fp-ts library.
인기도
- GitHub 스타
- 48k
- 순위
- #4650
- 라이선스
- MIT
- 업데이트
- 2026. 10. 15.
댓글
- …
이 저장소의 다른 스킬
00-andruia-consultant
48k에이전트가 AI 프로젝트를 시작하거나 개선할 수 있도록 코드를 분석하고 스페인어로 실행 계획을 세워 줍니다.
007
48k에이전트가 보안 감사와 위협 모델링을 수행해 공격과 취약점으로부터 프로젝트를 보호하도록 돕습니다.
10-andruia-skill-smith
48k에이전트가 AI 도구의 작동 방식을 정의하고 문서를 쓰며 구조를 검증하도록 돕습니다.
20-andruia-niche-intelligence
48k에이전트가 신뢰할 수 있는 자료를 바탕으로 특정 산업의 맥락, 규칙, 사용 패턴, 위험을 정리한 요약을 만들도록 돕습니다.