News for hackers. Stuff that matters.
Re:TypeScript Is Surprisingly OK for Compilers by chpatrick on Friday August 18, 2023 @05:34AM (#37173244)
Type-refining if in TypeScript is good enough for pattern matching if you ask me.
Re:TypeScript Is Surprisingly OK for Compilers by graftak on Friday August 18, 2023 @07:06AM (#37174030)
The TypeScript type system meta programming actually does pattern matching very well, it’s just the underlying JS runtimes that can’t, there is a proposal for it though; https://github.com/tc39/proposal-pattern-matching.