fram-lang / fram-lang/dbl

Syntax for empty lambda abstraction with named parameters.

Open
#263 0 comments 0 reactions 0 assignees View on GitHub
0. parsing good first issue
Dominant language
OCaml
Stars
45
Forks
28
PR merge metrics
No merged PRs in 30d

Description

Currently, there is a semantic difference between implicit and explicit abstraction of implicit parameters when higher-order function is called. When all named parameters are omitted, all implicit parameters are introduced to the environment, while when some named parameters are abstracted, only explicitly abstracted parameters are introduced. For instance, consider the following code.
```
let foo {~n} (f : {~n, x} -> Unit ->> _) =
f (fn () => ~n); # ~n refers to the implicit parameter of a lambda
f (fn {~n} => ~n); # same as above, but stated explicitly
f (fn {x} => ~n); # ~n refers to parameter of foo
()
```
I'm still not sure if this behavior is the right one, but if we do so, it might be useful to mark lambda abstraction as explicitly taking named parameters to enforce the latter behavior, but naming none of them, like `f (fn {} => ~n)`. The implementation of the type-checker can handle that (`PF_Fn` constructor can take empty list), so only the parser should be updated.

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.