effekt-lang / effekt-lang/effekt

Local records

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

Description

This can be nice to have for obvious reasons, but it's necessary for some crazier ones (due to lack of #271 and #67).
A very simple example is: imagine you need a (boxed) function that refers to its type in some way (e.g. returns itself). That's not possible normally since that'd be an infinitely long type, but you can write it just fine with records:
```effekt
record Foo(block: () => Foo at {})
```
However, you can't do that if the block has captures:
```effekt
def bar() = region this {
record Foo(block: () => Foo at {this}) // Only supported on the toplevel: record declaration.
}
```

I have a complex use case (which doesn't work currently) with a peculiar scheduler that doesn't use multiple resumptions, but still allows captures.

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.