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

You can have both union types and sum types (imo ideally), or in this case can easily choose to represent the result of the expensive computation in a more reasonable/descriptive way.


Perhaps the more reasonable/descriptive way to represent the potentially no-value result of the computation is with a sum type, not a union type?




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: