effekt-lang / effekt-lang/effekt

Handling without control

Open
#252 3 comments 1 reaction 0 assignees View on GitHub
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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.