id, title, category, status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, verification_status, tags, raw_sources, last_reinforced, github_commit, tech_stack
| id |
title |
category |
status |
canonical_id |
aliases |
duplicate_of |
source_trust_level |
confidence_score |
verification_status |
tags |
raw_sources |
last_reinforced |
github_commit |
tech_stack |
| wiki-2026-0508-functional-programming |
Functional Programming |
10_Wiki/Topics |
verified |
self |
|
none |
A |
0.9 |
applied |
| functional |
| paradigm |
| immutability |
|
|
2026-05-10 |
pending |
| language |
framework |
| Haskell/Scala/F# |
cats/zio/fp-ts |
|
Functional Programming
매 한 줄
"매 functions as values, immutability as default." Lambda calculus (Church 1936)에서 origin, Lisp (1958) → ML → Haskell → modern (Scala 3, F#, Rust influence) 의 lineage. 매 2026 mainstream — React hooks, Rust ownership, TypeScript의 functional patterns가 매 industry default.
매 핵심
매 Pure functions
- 매 input → output 의 deterministic.
- 매 side-effect 없음 (no I/O, no mutation, no global state).
- 매 referential transparency —
f(x) replaceable with its value.
매 Immutability
- 매 data 의 not modified — 매 new value created instead.
- 매 structural sharing (persistent data structures) 의 efficiency 보장.
- 매 concurrency safety 자동 — 매 lock 의 X.
매 Higher-order functions
- 매 functions as arguments / return values.
- map, filter, fold/reduce 의 compositional building blocks.
- 매 closures 의 lexical scope capture.
매 응용
- React hooks — 매 functional component의 default.
- Spark / Flink — 매 distributed FP for big data.
- Rust iterators — 매 zero-cost FP abstractions.
- Domain modeling — 매 ADTs (sum/product types) 의 type-safe.
💻 패턴
Pure function
Map / Filter / Reduce
Currying
Function composition
Algebraic Data Types
Monad (Option/Maybe)
Persistent data structure
Lens / optics
매 결정 기준
| 상황 |
Approach |
| Concurrent / distributed system |
FP (immutability 의 free safety) |
| Domain modeling with invariants |
FP + ADTs (Scala/Rust/Haskell) |
| Performance-critical loop |
OOP/imperative (cache-friendly, mutation OK) |
| UI components |
FP (React hooks, Elm) |
| Data pipelines |
FP (Spark, Flink, dplyr) |
기본값: 매 functional core, imperative shell (Gary Bernhardt) — 매 pure logic + thin I/O boundary.
🔗 Graph
🤖 LLM 활용
언제: domain modeling, parser/interpreter design, concurrent code review, type-driven development.
언제 X: 매 tight numeric loop optimization, low-level hardware drivers (mutation/state inevitable).
❌ 안티패턴
- Premature abstraction: 매 monad transformer stack을 매 simple problem에 매 over-engineering.
- Pure-only dogma: 매 모든 I/O를 IO monad에 매 wrap — 매 readability 손해.
- Recursion-only: 매 stack overflow 가능 — 매 tail-call optimization 의존.
🧪 검증 / 중복
- Verified (Bird & Wadler "Introduction to Functional Programming", Okasaki "Purely Functional Data Structures").
- 신뢰도 A.
🕓 Changelog
| 날짜 |
변경 |
| 2026-05-08 |
Phase 1 |
| 2026-05-10 |
Manual cleanup — FP fundamentals, ADTs, monads, modern industry use |