Replies: 3 comments 4 replies
-
Here's some concerns I have about this sort of thing in Unison:
In general, untagged unions seem like a feature that makes more sense in dynamically typed languages. I'm happy to be proven wrong though. :) I wonder if we could do some extensible sum types implementation, similar to the extensible records proposal but for sums / unions. These would be tagged unions, but I wonder if the syntax could be made just as ergonomic. Here's the extensible records proposal #3845 cc @dolio who might have more thoughts on this. |
Beta Was this translation helpful? Give feedback.
-
not convinced that this is the case typescript doesn't support matching on type, since they are all erased... but it does support matching on "runtime" type (for those values that have a way to distinguish) i would actually prefer it if scala didn't support matching on type either since it's flaky |
Beta Was this translation helpful? Give feedback.
-
The particular example is niche, but I run into this all the time in different contexts:
That's just in unison... in most of my typescript projects you'll see it untagged unions used in almost every file. |
Beta Was this translation helpful? Give feedback.
-
@alvaroc1 posted this in the Slack:
Beta Was this translation helpful? Give feedback.
All reactions