3 ms·
If I'm understanding correctly, refinement types[1] solve this by allowing you to constrain a type into a smaller set of values. Think set notation: ``` type T
by potsandpans 3y ago
If I'm understanding correctly, refinement types[1] solve this by allowing you to constrain a type into a smaller set of values. Think set notation:
```
type Temperature<min: number, max: number> = { x: number | x >= min && x <= max }
```
[1] - https://arxiv.org/pdf/2010.07763.pdf https://arxiv.org/pdf/2010.07763.pdf