Unify GADT syntax
Nobody has claimed this yet.
- Dominant language
- OCaml
- Stars
- 10.3k
- Forks
- 438
- PR merge metrics
- No merged PRs in 30d
Description
See the discussion here: https://github.com/facebook/reason/issues/491#issuecomment-222324029
We can make GADTs less scary, by making them a natural syntactic extension of regular variant declarations.
One proposal is as follows, but is more verbose, so if you have better ideas, please discuss here:
If regular variant definitions were as follows:
type something =
| Constructor (int, int) : something
| Another (list int) : something;
Then creating a GADT is not such a huge step, and the syntax helps to explain what GADTs are in the first place.
type something 'a =
| Constructor (int, int) : something int
| Another (list int) : something unit;
The only problem is that (as the first example shows), in the case of regular variant definitions, there is a lot of redundancy. I'm hoping someone has a good proposed solution for this.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked discussion at https://github.com/facebook/reason/issues/491#issuecomment-222324029 and compare the regular variant and GADT syntax examples in this issue. No implementation files or tests are named. The work is done when a syntax proposal is agreed on and its required implementation and tests are identified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ocaml
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100