effekt-lang / effekt-lang/effekt
Handling without control
Open
feature
- Dominant language
- Scala
- Stars
- 469
- Forks
- 41
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 23
Description
It would be great if objects could be passed implicitly without introducing an effect handler.
```
interface State {
def get(): Int
def set(x: Int): Unit
}
def myComputation(): Int / State = do get()
def main() = {
var s = 0;
with State {
def get() = s
def set(x: Int) = s = x
};
myComputation()
}
```
The typing rule for `with` should be like
```
Γ |- b : F Γ |- s : 𝜏 / ε
――――――――――――――――――――――――――――――
Γ |- with b; s : 𝜏 / (ε - F)
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.