Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
egwynn
· 9y ago · 0 comments
In this case, I prefer FP-style destructured pattern matching (e.g.
https://doc.rust-lang.org/book/patterns.html#destructuring
) to OOP-style method overloading (FTA). In the FP style, the compiler can make sure you handle all possibilities.
Comments
[–]
rdnetto
9y ago
It's worth noting you can implement something similar in OOP languages using Church encoding:
http://blog.higher-order.com/blog/2009/08/21/structural-patt...