Wim Jongeneel
1 min readMay 20, 2020

--

Aside of the pretty clean syntax you can implement pattern matching in TypeScript by using the existing language features. The TypeScript type system is so more powerful then those of Reason or F# and is totally capable of type checking patterns and inferring results. I wrote an article on this: https://medium.com/swlh/pattern-matching-in-typescript-with-record-and-wildcard-patterns-6097dd4e471d?source=friends_link&sk=adf3e0c17b9c5eaefb029a7491b5596e. The code is also published on npm under typescript-pattern-matching.

--

--

Wim Jongeneel
Wim Jongeneel

Written by Wim Jongeneel

Software Engineer at Mendix (Rotterdam, The Netherlands) • Student MSc Software Engineering • Functional programming enthusiast

Responses (1)