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

fp-pragmatic

하는 일

이 가이드는 함수형 프로그래밍의 핵심 개념을 실용적으로 가르칩니다. 복잡함 없이 코드를 개선하는 데 실제로 중요한 것에 집중합니다.

사용하는 경우

  • ✓TypeScript에서 함수형 프로그래밍을 시작하고 싶을 때.
  • ✓함수형 프로그래밍 아이디어를 빠르게 익히고 싶을 때(80/20 방식).
  • ✓함수형 프로그래밍이 언제 도움이 되고 언제 코드를 단순하게 두어야 하는지 이해하고 싶을 때.

스킬 링크

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/fp-pragmatic/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-pragmatic/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“TypeScript에서 함수형 프로그래밍을 간단하게 시작하려면 어떻게 해야 하나요?”

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

작동 방식

유용한 패턴에 집중하고 학술적인 전문 용어는 피하며, 실제 결과를 주는 개념을 적용하는 방법을 보여 줍니다.

기술 내용 (원본 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

  • You want a pragmatic starting point for fp-ts or functional programming in TypeScript.
  • The task is exploratory or educational and needs an 80/20 view of what is actually worth adopting.
  • You need guidance on when FP helps and when it is better to keep code simple.

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.
자주 묻는 질문

함수형 프로그래밍이란 무엇인가요?

데이터를 변환하는 함수를 중심으로 소프트웨어를 만드는 프로그래밍 방식입니다. 상태를 바꾸기보다 함수가 데이터를 변환하는 과정에 주목합니다.

함수형 프로그래밍을 언제 쓰지 말아야 하나요?

간단한 코드로 문제가 해결될 때(예: 간단한 null 검사)나 팀이 이 방식에 익숙하지 않을 때는 피하세요.

이 가이드가 함수형 프로그래밍을 모두 가르치나요?

아닙니다. 학술적 용어를 빼고, 가장 큰 결과를 내는 20%의 개념에 집중합니다.

상세 정보

작성자의 원본 설명

A practical, jargon-free guide to functional programming - the 80/20 approach that gets results without the academic overhead

repo: sickn33/agentic-awesome-skills

인기도

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

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬