3 ms·
You can try and take some old JS lib and annotate it in TS. It'll work. It'll be very clunky, and full of any/unknown. There's a reason why strong static typea
by pas 7y ago
You can try and take some old JS lib and annotate it in TS. It'll work. It'll be very clunky, and full of any/unknown.
There's a reason why strong static typeable code looks the way it looks (basically functional programming). You can type a monad chain, because it's a container type for arbitrary types interacting, but you can't easily type a switch nested in a for loop that uses a queue to walk a tree.
Of course the flip side is that to walk a tree functionally you need recursion schemas, and they are ugly/complex.