Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

One of the things I like about Guards is that you can enforce/match against types as needed.


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.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: