Relax the condition that type synonyms must be fully-applied
- 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.