|
|
|
# Liberal Type Synonyms
|
|
|
|
|
|
|
|
## Brief Explanation
|
|
|
|
|
|
|
|
|
|
|
|
See the [ GHC Documentation](http://www.haskell.org/ghc/docs/latest/html/users_guide/type-extensions.html#type-synonyms) on this extension.
|
|
|
|
|
|
|
|
|
|
|
|
The basic idea is that type validity checking is done *after expanding type synonyms*. This means that type synonyms can be written unsaturated, as long as the result of expanding synonyms leaves everything saturated. This is sometimes quite useful.
|
|
|
|
|
|
|
|
|
|
|
|
There are also interactions with [RankNTypes](rank-n-types) - a type synonym may expand to a quantified type.
|
|
|
|
|
|
|
|
## Proposal
|
|
|
|
|
|
|
|
|
|
|
|
Adopt GHC's approach to type synonym expansion.
|
|
|
|
|
|
|
|
## References
|
|
|
|
|
|
|
|
- [ GHC Documentation](http://www.haskell.org/ghc/docs/latest/html/users_guide/type-extensions.html#type-synonyms)
|
|
|
|
|
|
|
|
## Tickets
|
|
|
|
|
|
|
|
<table><tr><th>[\#102](https://gitlab.haskell.org//haskell/prime/issues/102)</th>
|
|
|
|
<td>add Liberal Type Synonyms</td></tr></table>
|
|
|
|
|
|
|
|
## Pros
|
|
|
|
|
|
|
|
- Small generalisation
|
|
|
|
- Easily specified
|
|
|
|
- Quite handy
|
|
|
|
|
|
|
|
## Cons
|
|
|
|
|
|
|
|
- any? |