Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Want Discriminated Unions in Kotlin? Use a Sealed Class (atomicobject.com)
2 points by ingve 5 months ago | hide | past | favorite | 1 comment


Discriminated unions are a terrible way to enforce type safety. They are a backport of a physical-data-modelling antipattern. Inheritance or GTFO.




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

Search: