effect-handlers-implementer
Skill17 starsChanged 9 months agoApache-2.0View on GitHub
Implements effect handlers for algebraic effects. Use when: (1) Building
In this repository98 other files it gives its agents.
- abstract-interpretation-engineSkill
- abstract-machineSkill
- acsl-annotation-assistantSkill
- actor-model-implementerSkill
- algebraic-effectsSkill
- alias-and-points-to-analysisSkill
- axiomatic-semanticsSkill
- bidirectional-type-checkingSkill
- bisimulation-checkerSkill
- capability-systemSkill
- closure-converterSkill
- common-subexpression-eliminatorSkill
- concurrency-verifierSkill
- constant-propagation-passSkill
- contextual-equivalenceSkill
- control-flow-analysisSkill
- coq-proof-assistantSkill
- cps-transformerSkill
- dafny-verifierSkill
- dataflow-analysis-frameworkSkill
- dead-code-eliminatorSkill
- defunctionalizationSkill
- denotational-semantics-builderSkill
- dependent-type-implementerSkill
- dsl-embeddingSkill
- effect-systemSkill
- effect-type-systemSkill
- escape-analysisSkill
- existential-typesSkill
- ffi-designerSkill
- fuzzer-generatorSkill
- gadt-implementerSkill
- garbage-collector-implementerSkill
- graalvm-truffle-implementerSkill
- gradual-typing-implementerSkill
- higher-order-abstract-syntaxSkill
- hoare-logic-verifierSkill
- incremental-computationSkill
- information-flow-analyzerSkill
- inline-expanderSkill
- interprocedural-analysisSkill
- invariant-generatorSkill
- jit-compiler-builderSkill
- lambda-calculus-interpreterSkill
- language-server-protocolSkill
- lean-proverSkill
- lexer-generatorSkill
- linear-type-implementerSkill
- liveness-analysisSkill
- llvm-backend-generatorSkill
- lock-free-data-structureSkill
- loop-optimizerSkill
- loop-termination-proverSkill
- macro-expanderSkill
- memory-allocatorSkill
- message-passing-systemSkill
- mlir-dialect-designerSkill
- model-checkerSkill
- module-systemSkill
- monad-transformerSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 71
Start with simple effects (state, fail)
- Distinctive: line 72
Use effect rows for polymorphism
- Distinctive: line 74
Test handlers in isolation
- Distinctive: line 75
Consider performance of continuations
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Effect Handlers Implementer
Implements effect handlers for algebraic effects and resumable exceptions.
When to Use
- Building effect systems
- Implementing custom effects (I/O, state, nondeterminism)
- Creating extensible effect systems
- Implementing error handling
- Building async/await with effects
What This Skill Does
- Defines effects - Algebraic effect signatures
- Implements handlers - Effect interpretation
- Manages continuations - Resumable computations
- Composes handlers - Layered interpretations
Key Concepts
| Concept | Description |
| Effect | Operation signature (type of operations) |
| Handler | Interpretation of effects |
| Continuation | Remaining computation |
| Resumption | Continue after handling |
| Abort | Stop computation |
Common Effects
| Effect | Operations | Handler |
| State | get, put | StateHandler |
| Exceptions | throw, catch | FailHandler |
| I/O | read, write | IOHandler |
| Non-det | choose, fail | ChoiceHandler |
| Random | random | RandomHandler |
| Async | async, await | AsyncHandler |
Handler Composition
| Pattern | Description |
| Shallow | One-shot handling |
| Deep | Intercept nested effects |
| Scoped | Dynamic handler scope |
| Layered | Multiple handlers |
Tips
- Start with simple effects (state, fail)
- Use effect rows for polymorphism
- Handle resource cleanup with finally
- Test handlers in isolation
- Consider performance of continuations
Related Skills
effect-type-system- Effect type systemspolymorphic-effects- Effect polymorphismlambda-calculus-interpreter- Basic interpretation
Canonical References
| Reference | Why It Matters |
| Plotkin & Pretnar, "Handlers of Algebraic Effects" (2009) | Original effect handlers |
| Koka Language | Production effect system |
| Eff Language | Research effect language |
| Frank Language | Effect handlers in practice |
Tradeoffs and Limitations
Approaches
| Approach | Pros | Cons |
| Monadic | Simple, composable | Verbose |
| Effect handlers | Extensible, modular | Complex implementation |
| Delimited continuations | Powerful | Hard to use |
Limitations
- Performance overhead for continuations
- Complex to implement correctly
- Debugging is challenging
- Limited static analysis
- Some effects can't be handler
Research Tools & Artifacts
Real-world effect handler implementations:
| Tool | Why It Matters |
| Koka | Production language with effect types |
| Frank | Effect handlers research language |
| Eff | Effect handlers implementation |
| OCaml effects | Experimental effects in OCaml |
| Multicore OCaml | Effect handlers for OCaml |
Key Systems
- Koka: Microsoft research effect language
- Frank: Chameleon in the forest
Research Frontiers
Current effect handler research:
| Direction | Key Papers | Challenge |
| Typed handlers | "Handlers of Algebraic Effects" | Type-safe handlers |
| Continuations | "Delimited Control" | Efficient continuations |
| Effect polymorphism | "Polymorphic Effects" | Reusable handlers |
Hot Topics
- Effect handlers for web: Async via handlers
- Effects in Rust: Effects RFC discussion
Implementation Pitfalls
Common effect handler bugs:
| Pitfall | Real Example | Prevention |
| Resume after abort | Double resume | Track state |
| Stack overflow | Deep continuations | Tail-call opt |
| Handler order | Wrong handler catches | Order matters |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

