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

Do you have an example of the kind of validation couldn't be expressed in the type system?


Min or max length of an input. Any type of string validation like email or something similar that's validated via regex.


root_axis gave some good examples. Also types like `int` or `decimal` (which you can also pair with branded static types, but they don't actually guarantee anything other than their name. Really any kind of refinement you can imagine on primitive types.




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

Search: