원클릭으로
effect-system
Implement effect systems to track and control side effects in programs.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Implement effect systems to track and control side effects in programs.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Implement abstract machines for defining and executing operational semantics of programming languages.
Implements alias and points-to analysis for pointer programs. Use for: (1) Optimizing compilers, (2) Verifying memory safety, (3) Program understanding, (4) Parallelization.
Define program meaning through logical assertions and proof rules (Hoare logic).
Transforms closures to explicit environments. Use when: (1) Implementing functional languages, (2) Building compilers, (3) Understanding closures.
Implements common subexpression elimination (CSE). Use when: (1) Building compilers, (2) Optimizing code, (3) Program analysis.
Implements general dataflow analysis framework. Use when: (1) Building compilers, (2) Static analysis tools, (3) Program verification.
| name | effect-system |
| description | Implement effect systems to track and control side effects in programs. |
| version | 1.0.0 |
| tags | ["effects","types","purity","popl"] |
| difficulty | intermediate |
| languages | ["haskell","purecript","koka"] |
| dependencies | ["type-checker-generator","type-class-implementer"] |
Effect systems track what computational effects a function may perform, enabling reasoning about purity, exceptions, I/O, and other side effects at the type level.
| Concept | Description |
|---|---|
| Effect | Computational side effect (IO, State, Throw) |
| Effect Set | Collection of effects |
| Effect Row | Extensible row of effects |
| Effect Polymorphism | Generic over effect sets |
| Effect Handler | Interpret effects |
| Pure | No effects |
algebraic-effects - Algebraic effect handlerstype-class-implementer - Monad type classesmonad-transformer - Monad transformersinformation-flow-analyzer - Security effects| Reference | Why It Matters |
|---|---|
| Lucassen & Gifford, "Polymorphic Effect Systems" (POPL 1988) | Original paper on effect systems |
| Talpin & Jouvelot, "The Type and Effect Discipline" (POPL 1992) | Effect polymorphism formalization |
| Leijen, "Koka: Programming with Row Polymorphic Effect Handlers" (2017) | Modern effect system design |
| Approach | Pros | Cons |
|---|---|---|
| Monads | Composable | Syntactic overhead |
| Effect systems | Cleaner syntax | Complex inference |
| Algebraic effects | Flexible | Runtime overhead |
A high-quality implementation should have:
| Criterion | What to Look For |
|---|---|
| Soundness | All effects tracked |
| Inference | Automatic effect inference |
| Polymorphism | Effect polymorphism |
| Handlers | Effect interpretation |
✅ Good: Sound, infers effects, supports polymorphism ⚠️ Warning: Manual annotations required ❌ Bad: Misses effects, no polymorphism
Effect system implementations:
| Tool | Language | What to Learn |
|---|---|---|
| Koka | Koka | Row-based effects |
| Frank | Frank | Handler calculus |
| Eff | Eff | Direct handlers |
| Multicore OCaml | OCaml | Effects in OCaml |
| Pitfall | Real Consequence | Solution |
|---|---|---|
| Effect inference | Complexity | Use bidirectional |