3 ms·
Guards are nice, but compared to static typing, they a run time check whereas static typing alerts you to errors at compile time.
by theonething 7y ago
Guards are nice, but compared to static typing, they a run time check whereas static typing alerts you to errors at compile time.
- 1_player 7y agoGuards are mostly used to do pattern matching, not to specify which types a function accepts, though you can use them as such.
- andy_ppp 7y agoI’m a fan of static types don’t get me wrong, I’m just saying with guards and dialyser it’s 60% of the way there compared to nothing. Also I don’t seem to make to class of errors I do in other languages because 90% of this time passing the wrong thing breaks immediately due to pattern matching.