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

> That information can be encoded into the class type

This. I did the very same thing when dealing with some code that was frequently converting between three coordinate systems. Using Haskell code duplication was close to non existent and still type-safe. Not wanting to sound too fan-boyish ... but that was one of the first times that I realized that a good type-system can help you prevent whole classes of bugs.




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

Search: