Hacker News new | past | comments | ask | show | jobs | submit login

Guards are nice, but compared to static typing, they a run time check whereas static typing alerts you to errors at compile time.



I’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.


Guards are mostly used to do pattern matching, not to specify which types a function accepts, though you can use them as such.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: