34 ms·
Most statically-typed languages don't verify types at runtime either. As long as you enforce types at the boundaries between typed and untyped code, you should
by Dylan16807 8y ago
Most statically-typed languages don't verify types at runtime either. As long as you enforce types at the boundaries between typed and untyped code, you should be fine. And enforcing invariants at the boundaries of your code is pretty important for all languages.
- platz 8y agothe point is that in FP languages, pattern matching uses closed ADTs, so you always know at compile time if you've covered all the cases.
- Dylan16807 8y agoHuh, you have do something with returning from a switch in typescript if you want it to make sure all cases are covered. So it's close but not quite there.