https://github.com/nilern/ooee
Object oriented extensible effects
https://github.com/nilern/ooee
Last synced: 4 months ago
JSON representation
Object oriented extensible effects
- Host: GitHub
- URL: https://github.com/nilern/ooee
- Owner: nilern
- Created: 2017-01-21T18:15:00.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-25T19:25:33.000Z (over 9 years ago)
- Last Synced: 2025-09-14T15:51:20.341Z (9 months ago)
- Language: Scheme
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Object Oriented Extensible Effects
(See [Eff](http://www.eff-lang.org/) for terminology.)
* An effect type is a class
* An effect instance is an instance of the class
- Operations are just methods that take a delimited continuation and an
arbitrary number of other arguments
- Resources are just fields
- `val` and `finally` are methods that don't take the continuation
* A computation is just a special message send that prepends a delimited
continuation to the argument list
- The main purpose of installing a handler is actually setting up the
delimiter and storing the prompt tag in the effect instance
* Calls to `val` and `finally` are also set up on top of and below the
prompt, respectively; but this is mostly a convenience
- Overriding methods at the handler setup point is convenient in some
situations but complects defining the effect with installing it as a
handler.
* In Eff effect instances actually start out with *no methods at all*.
* Needing to create a new class for every effect handler is *beyond
Java-clunky* but a prototypal object model could help avoid that.
## TODO
- [x] `finally`
- [ ] install several instances as handlers at once
- [ ] investigate prototypal object model
- [ ] use something more mainstream than Scheme
* Multi-prompt multi-shot delimited continuation implementations are hard to
find...