3 ms·
I'm happy that you posted this. It's something that I discovered on my own, and have been tentatively arguing for years[1][2][3][4]. In fact, I never really un
by noblethrasher 10y ago
I'm happy that you posted this. It's something that I discovered on my own, and have been tentatively arguing for years[1][2][3][4].
In fact, I never really understood the visitor pattern until after I started using ML's pattern matching. The "eureka" moment came when I realized that not only do abstract classes map to sum types (logical disjunction), but interfaces correspond to product types (logical conjunction).
[1] https://www.reddit.com/r/programming/comments/2e572a/rebuttal_to_dynamic_langs_are_static/cjw7idz/ https://www.reddit.com/r/programming/comments/2e572a/rebutta...
[2] https://www.reddit.com/r/programming/comments/14t3ay/either_in_c_an_alternative_implemetation_of/c7g754y/ https://www.reddit.com/r/programming/comments/14t3ay/either_...
[3] https://news.ycombinator.com/item?id=822479 https://news.ycombinator.com/item?id=822479
[4] http://stackoverflow.com/questions/19696342/limiting-class-and-class-properties/19698123#19698123 http://stackoverflow.com/questions/19696342/limiting-class-a...