5 ms·
It's typical in statically typed functional languages to match against Algebraic data type value constructors. These ADTs have a fixed amount of variants, which
by verttii 7y ago
It's typical in statically typed functional languages to match against Algebraic data type value constructors. These ADTs have a fixed amount of variants, which makes it suitable to do a clean pattern match.
ADTs don't exist in OOP. It gets more complicated to do matches against classes whose abstractions are not really decomposable so easily.