algebraic-effects
Skill17 starsChanged 9 months agoApache-2.0View on GitHub
Implements algebraic effects and effect handlers for computational effects in typed languages.
In this repository98 other files it gives its agents.
- abstract-interpretation-engineSkill
- abstract-machineSkill
- acsl-annotation-assistantSkill
- actor-model-implementerSkill
- 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-handlers-implementerSkill
- 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
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
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 40
Start with simple effects (state, exceptions)
- Distinctive: line 41
Use deep handlers for full resumption
- Distinctive: line 42
Consider effect inference to reduce annotation burden
≈ “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
Algebraic Effects
Implements algebraic effects and effect handlers - a modular approach to computational effects where effects are described as operations and handled by handler functions.
When to Use This Skill
- Building languages with composable effects
- Implementing async/await, state, exceptions, logging, nondeterminism
- Researching effect systems and handlers
- Creating domain-specific effect languages
What This Skill Does
- Effect Signature Definition: Defines effects as sets of operations with types
- Effect Handler Implementation: Implements handlers that interpret effect operations
- Deep vs Shallow Handlers: Supports both continuation-based deep handlers and single-shot shallow handlers
- Effect Inference: Infers effect types from code using effect inference algorithms
Key Concepts
| Concept | Description |
| Effect Operation | Abstract description of an effect (e.g., State.get, State.put) |
| Effect Handler | Function that interprets effect operations |
| Resumption | Continuation passed to handler for resuming computation |
| Effect Row | Collection of effects tracked in type system |
Tips
- Start with simple effects (state, exceptions)
- Use deep handlers for full resumption
- Consider effect inference to reduce annotation burden
- Handlers compose via delegation
Related Skills
effect-system- Effect type trackingmonad-transformer- Alternative effect compositiontype-inference-engine- Effect inference
Canonical References
| Reference | Why It Matters |
| Plotkin & Pretnar "Handlers of Algebraic Effects" (2009) | Foundational effect handlers paper |
| Bauer & Pretnar "Programming with Algebraic Effects and Handlers" | Eff language implementation |
| Leijen "Koka: Programming with Row Polymorphic Effect Types" (2014) | Effect rows in practice |
| Kammar et al. "Handlers in Action" (ICFP 2013) | Comprehensive handler study |
Tradeoffs and Limitations
| Approach | Pros | Cons |
| Deep handlers | Full resumption, composable | Complex continuation management |
| Shallow handlers | Simpler implementation | Limited expressiveness |
| Monadic encoding | Familiar, pure | Effets verbosity, lack of local reasoning |
Assessment Criteria
| Criterion | What to Look For |
| Type safety | Effect operations well-typed |
| Handler correctness | Operations correctly interpreted |
| Performance | Minimal overhead vs monadic approach |
| Composability | Handlers can be layered |
Quality Indicators
✅ Good: Type-safe, correct handlers, good performance, composable ⚠️ Warning: Partial type safety, some handler issues ❌ Bad: Type errors, incorrect handler behavior
Research Tools & Artifacts
Algebraic effect implementations:
| Tool | Language | What to Learn |
| Eff | OCaml | Original implementation |
| Koka | Koka | Effect types |
| Frank | Frank | Handler calculus |
| Idris 2 | Idris | Effects |
Research Frontiers
1. Effect Inference
- Goal: Reduce annotation burden
- Approach: Row polymorphism, effect variables
- Papers: "A Theory of Effect Inference" (Lucassen & Gifford)
2. Algebraic Effects for Concurrency
- Goal: Composable concurrency primitives
- Approach: Effect handlers for async/await
- Papers: "Asynchronous Effect Handlers" (2019)
Implementation Pitfalls
| Pitfall | Real Consequence | Solution |
| Continuation leak | Memory issues | Proper resumption handling |
| Effect row ambiguity | Unclear effect set | Explicit row variables |
| Handler ordering | Wrong semantics | Define evaluation order |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

