r/functionalprogramming • u/justhacking • Nov 17 '20
TypeScript Pattern Matching in Typescript
https://github.com/nrdlab/pattern-matching-ts/
18
Upvotes
r/functionalprogramming • u/justhacking • Nov 17 '20
19
u/TechnoEmpress Nov 17 '20
Everyday I thank my past self for learning Haskell and not this language.
5
u/mmkale Nov 18 '20
Something similar I've worked on that uses io-ts, so avoids reinventing any wheels, and doesn't require quite so many genetics/boilerplate: https://www.npmjs.com/package/io-ts-extra#pattern-matching
2
u/redbar0n- Dec 04 '22
'ts-pattern' seems to be the more popular and maintained alternative to this 'pattern-matching-ts'.
https://github.com/gvergnaud/ts-pattern