3 ms·
And modify the switch statement to be able to ensure that all variants are handled.
by kubb 2y ago
And modify the switch statement to be able to ensure that all variants are handled.
- carlmr 2y agoExactly, since messing around with OCaml/F#/Rust I feel like sum-types + exhaustive match (with deconstruction) is such a powerful construct to prevent logic errors and ensure maintainability, that every language without it feels so limited.
- valenterry 2y agoYep, one of the reasons I could never be happy with Go. Union types and type-classes are of similar importance. Any modern language not having them (or an equal powerful feature) just feels sad.