4 ms·
Integration with a contract system like Clojure Spec is one of the best features still missing in current type systems. Having that would get best of the both w
by enugu 9y ago
Integration with a contract system like Clojure Spec is one of the best features still missing in current type systems. Having that would get best of the both worlds and allow better interaction with untyped code. Racket has this currently.
I like Typescript. But wish it had exact types like Flow. This leads to not being able to type a simple Algebraic Data Type with complete precision.
I think the reasoning given on the github page for not having exact types(involving how it plays with intersection types and union types) has a bug. One can assign T & U to T even when T is exact(exactness of T ensures U wont introduce extra properties), and assigning T to T | U should be fine when U is exact(For a user to determine if a T|U value is T or U, they will have to check whether a property in T exists, not U).
But this is a very small issue.