▲ | sunnydiskincali 4 days ago | ||||||||||||||||
> You wrote a lot of words to say very little. Substantiate this. > weird name choice but whatever I don't think this kind of snarky potshot is in line with the commentary guidelines. Perhaps you could benefit from a refresher? https://news.ycombinator.com/newsguidelines.html#comments > Thanks to subtyping, no contortion needed I see the same degree of contortion, actually. Far more noisy, at that. > No need to use 7 more lines to create a separate, unrelated type. You're still creating a type, because you understand that a sum-type with a different set of cases is fundamentally a different type. Just like a class with a different set of inheritance is a different type. And while it's very cute to compress it all into a single line, it's really not compelling in the context of readability and "write once, use many". Which is the point you were making, although it was on an entirely different part of the grammar. > Great analogy, except for the fact that someone from the Java team explicitly said they're drawing inspirations from ML. ML didn't invent ADTs, and I think you know it's more than disingenuous to imply the quotation means that the type-system in Java which hasn't undergone any fundamental changes in the history of the language (nor could it without drastically changing the grammar of the language and breaking the close relationship to the JVM) was lifted from ML. | |||||||||||||||||
▲ | ackfoobar 4 days ago | parent [-] | ||||||||||||||||
> Substantiate this. You never gave an example how sum types in Java/Kotlin cannot do what "real" sum types can. >> weird name choice but whatever > snarky potshot Sorry that you read snark. What I meant was "I find naming this 'Bound' weird. But since I am translating your example, I'll reuse it". > You're still creating an unrelated type How can a type participating in the inheritance hierarchy be "unrelated"? > I see the same degree of contortion, actually. Far more noisy, at that. At this point I can only hope you're a Haskeller and do not represent an average OCaml programmer. | |||||||||||||||||
|