Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: