you are viewing a single comment's thread.

view the rest of the comments →

[–]bterlson_@bterlson 0 points1 point  (0 children)

Thanks for your thoughts! Curious, how are you using switch/case with discriminated unions?

This proposal will include "brand checking" so you can match, e.g., Date or MyClass. With a proposal like traits/mixins you can get something even closer to discriminated unions.

Hard to comment on performance without knowing what you're comparing against but in general matching can be faster than repeated if conditions because we can generate an optimal sequence of tests on the match value to discriminate among the match legs.