exploring-reasonml icon indicating copy to clipboard operation
exploring-reasonml copied to clipboard

Chapter: Polymorphic variant types

Open rauschma opened this issue 7 years ago • 1 comments

rauschma avatar Feb 07 '18 06:02 rauschma

My 2 cents, it's better to mention(emphasis) we can extent shape in this way: type shapePlus = [ | shape |Triangle(point, point, point) ]; ` in addition to the #shape in switch, we get the power of extending a program without touching the original code! I can see this pattern as predicate dispatch(generalized multi-dispatch) and it's awesome!

geohuz avatar Nov 27 '18 08:11 geohuz