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

Better to use a type which cannot represent an invalid state.

For example, instead of defining `inc` with `Int`s, the equivalent of an `IncrementalInt` type parameter for the `inc` function will ensure correctness without requiring runtime assertions.



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

Search: