3 ms·
I’m writing a TypeScript package for pattern matching by using generator functions. https://github.com/RoyalIcing/yieldpattern https://github.com/RoyalIcing/yi
by burntcaramel 6y ago
I’m writing a TypeScript package for pattern matching by using generator functions.
https://github.com/RoyalIcing/yieldpattern https://github.com/RoyalIcing/yieldpattern
It’s amazing to me how much pattern matching, well, matches how I think. A conditional if statement means I have to explicitly read properties off an object or inspect an array to check for what I want. Whereas pattern matching means asking ‘I want something that looks like this’ and do the work for me.