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

> The sum type, which the author is talking about, is not the same as "discriminated union" pattern, the latter being the crude implementation of the former.

Could you say something about the difference between the two? I'm not aware what it is.

Edit: wow I accidentally a word.




IIRC discriminated unions are plain C(++) unions with an added type tag, like at the beginning of the article. Brittle, prone to breakage when refactoring, etc. when compared to real sum types.




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

Search: