▲ | wiseowise 5 days ago | ||||||||||||||||
Kotlin's/Java's implementation is just a poor man's implementation of very restricted set of real sum types. I have no idea what > This has the benefit of giving you the ability to refer to a case as its own type. means. | |||||||||||||||||
▲ | ackfoobar 5 days ago | parent [-] | ||||||||||||||||
> I have no idea I can tell. Thankfully the OCaml textbook has this explicitly called out. https://dev.realworldocaml.org/variants.html#combining-recor... > The main downside is the obvious one, which is that an inline record can’t be treated as its own free-standing object. And, as you can see below, OCaml will reject code that tries to do so. | |||||||||||||||||
|