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

I disagree. Whenever there is a null pointer in the API, you could (and probably should) be using a sum type instead.

Sum types are not novel (Standard ML had them 40 years ago), but I think they are indeed a game changer.



You’ve described std::optional, a special case of std::variant.




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

Search: