Hacker News new | ask | show | jobs
by masklinn 2192 days ago
Non-generic sum types are useful but you can’t build an option or result type out of them, so the usefulness is somewhat hampered.
1 comments

But you don't need to, generic Option and Result types could be built as part of the standard library.
Yes but then you need neither sum types nor user-defined generics, you can just build-in whatever sugar is useful or necessary (possibly repurposing existing sugar e.g. the `select` statement).
sum types are still super useful imo without generics.