Y
Hacker News
new
|
ask
|
show
|
jobs
by
sitkack
4280 days ago
If you get tired of the switch statement, pattern matching is the functional dual of polymorphic dispatch.
1 comments
eru
4278 days ago
Even though, pattern matching (and algebraic datatypes) would work just as well in an imperative language as in a function setting.
(Not sure, whether you'd need garbage collection to make pattern matching really useful, though.
link
sitkack
4278 days ago
Pattern matching is welcomed everywhere, it saves conditionals and keeps the code clean.
link
(Not sure, whether you'd need garbage collection to make pattern matching really useful, though.