DanielXMoore / Civet

A TypeScript superset that favors more types and less typing
https://civet.dev
MIT License
1.55k stars 33 forks source link

Postfix `if`/`unless` in types #1385

Closed bbrk24 closed 2 months ago

bbrk24 commented 2 months ago

There are some cases where the other order feels more natural, particularly because unless/then is an awkward combination

// before
SpecificNumber<N < number> ::= unless number < N then NoUnion<N>

// after
SpecificNumber<N < number> ::= NoUnion<N> unless number < N