effekt
effekt copied to clipboard
Automatic eta expansion of block arguments
Currently, block arguments always have to be fully applied:
map([1, 2, 3]) { a => f(a) }
Instead, we could also support
map([1, 2, 3]) { f }
which could desugar to the above version.
Similarly, we could allow partial application:
f: (Int)(Int) -> T
map([1, 2, 3]) { f(1) }
desugaring to
map([1, 2, 3]) { x=> f(1)(x) }
The desugaring is type directed and should always lead to fully applied blocks. This is necessary to eventually adapt capabilities.
There are multiple possible designs to where the desugaring can take place. Since it is type directed, we further need to investigate interaction with overload resolution.