11 ms·
Aha! There's the crux of an argument. It's a valid point actually, that ties into the expression problem. As an OO apologist I do feel compelled to point out t
by lacampbell 10y ago
Aha! There's the crux of an argument. It's a valid point actually, that ties into the expression problem.
As an OO apologist I do feel compelled to point out that
type Animal = Cat | Dog | Mouse
let react = function (a, b)
| Cat, Dog -> ...
...
| x, y -> $"{x} is not interested in {y}."
Would suffer from the exact same issue though.
- lmm 10y agoOnly if you deliberately add the catch-all case. If you don't and just handle all the cases explicitly, many languages will give you a warning or error when you add a new unhandled variant.
- lacampbell 10y agoYeah, it's a valid point.