3 ms·
But you still have to validate and parse unstructured data in Haskell as well. And what would be the point of having the type checking done at run time? That's
by agentultra 8y ago
But you still have to validate and parse unstructured data in Haskell as well. And what would be the point of having the type checking done at run time? That's what many dynamic programming languages already do. If you're curious about Flow or TS then you must already have a problem with that approach.
Type checkers are tools that help us reason about, structure, and correct code. That's all.
Flow is decent these days but will probably never be as powerful as Haskell. My only gripe is that it forces my team to write verbose code at times in order to gain the benefits: you lose point-free style, gain a bunch of identity and instance checks... but it's a small trade off to make.
One small trick worth remembering and using in Flow to gain something similar to exhaustive type checking is to cast to the empty type in the default case when pattern matching on a type[0].
It's not an elegant type system but if you have experienced a good type system (like Haskell's) then it does make using Flow/TS much easier.
[0] https://medium.com/@ibosz/advance-flow-type-1-exhaustive-checking-with-empty-type-a02e503cd3a0 https://medium.com/@ibosz/advance-flow-type-1-exhaustive-che...