fram-lang / fram-lang/dbl

ADT constructors in a type-checking mode

Open
#3 0 comments 0 reactions 0 assignees View on GitHub
1. type inference
Dominant language
OCaml
Stars
45
Forks
28
PR merge metrics
No merged PRs in 30d

Description

In a bidirectional type-checker we can take advantage of a type-checking mode in case of constructors of ADTs, and do not require the full module path to be provided by the programmer. However, we treat constructors as regular functions in expressions, and we switch from a type-checking mode to a type-inferring mode in case of a function application. This two decisions in combination make type-checking of shadowed or not imported constructors more challenging. Consider the following code, which could be considered valid.
```
data A = A
data B = A of A
data C = A of B

let _ = A (A A)
```
At the moment I do not see any *simple* solution to this problem, so any ideas are welcome.

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.