2 ms·
We've been using this approach in Typescript. It's more palatable than Haskell since you can express an array that has at least one element as a variadic tuple
by nicusor 6y ago
We've been using this approach in Typescript. It's more palatable than Haskell since you can express an array that has at least one element as a variadic tuple `[T, ... T]`. Having the possibility to encode invariants in types is very useful, although it gets harder at times since TS chokes when you push it to its limits. Note that this happens in an old Meteor codebase that was completely JS a year and a half ago.