fram-lang / fram-lang/dbl

Relax the condition that type synonyms must be fully-applied

Open
#226 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

Requiring that type synonyms must be fully-applied might be to restrictive. We could relax this condition, and allow not fully-applied type synonyms in explicit type instantiations and definitions of other synonyms, provided that at each use they get enough parameters, to be fully applied. For instance, the following code could be considered valid, because each use of `T` in the definition of `Map` gets one parameter.
```
data Map Key = Map of
{ T
, empty : {type X} -> T X
, add : {type X} -> T X -> Key -> X -> T X
}

type AssocList Key Val = List (Pair Key Val)

let make {Key} = Map
{ T = AssocList Key
, empty = []
, add = fn xs k v => (k, v) :: xs
}
```

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.