Slide 37
Slide 37 text
Pattern matching
const result = t.match(myCurrentKebab,
//do something if the kebab is vegetarian
VegetarianKebab, (kebab) => ... ,
//do something else for all other kebab
Kebab, (kebab) => ... ,
//this is definitely not a kebab
t.Any, (x) => ...
);
The value to match against
Type to match
Function to execute if
the associated type is
matched