News for hackers. Stuff that matters.
Re:Pattern Matching in Ruby 2.7 (2019) by verttii on Thursday January 09, 2020 @07:22AM (#22000581)
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.

There are no comments on this comment yet.