effekt-lang / effekt-lang/effekt

Using objects for handler implementations

Open
#406 3 comments 0 reactions 0 assignees View on GitHub
area:compiler feature
Dominant language
Scala
Stars
469
Forks
41
Avg merge
1d 16h
Merged PRs (30d)
23

Description

As mentioned in #365 ([here](https://github.com/effekt-lang/effekt/issues/395#issuecomment-1961690461)), it should be possible to use objects as handler implementations.

```scala
// ...

def handler = new Handler {
def catch[R]{ p: => R / Exc } { h: String => R } =
try { p() } with Exc {
def raise[A](msg) = h(msg)
}
}

def main() = try { p() } with handler;
```

Currently, this is not possible but should be for tail-resumptive operations.

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.