tc39/proposal-pattern-matching
View on GitHub ↗ ★ 5,806 HTML
Pattern matching syntax for ECMAScript
41 mentions on Hacker News by 37 people: 7 stories, 34 comments · first 2017-07-05 · latest 2026-02-01
20082026
-
It will get pattern matching when JS does. Not certain yet but in progress. https://github.com/tc39/proposal-pattern-matching
comment by fourthark · 2025-11-23 · in `satisfies` is my favorite TypeScript keyword (2024) -
…is largely wrong and misleading. Pattern matching is still Stage 1, meaning it’s not a standard: https://github.com/tc39/proposal-pattern-matching Pipeline operator is Stage 2 and won’t use the “|>” syntax:…
comment by mattvr · 2025-11-07 · in JavaScript Just Leveled Up: ES2025 – You'll Fall in Love With -
…someone needs to champion it, and then there is the "at least two implementations" factor. https://github.com/tc39/proposal-pattern-matching
comment by pjmlp · 2025-04-29 · in Migrating away from Rust -
…redundant code to get the bindings; perhaps the `passes` test could return optional bindings.) [1]: https://github.com/tc39/proposal-pattern-matching
comment by Leftium · 2024-09-07 · in Show HN: Switch statement + lambdas = pattern matching in DeltaScript -
…a necessary evil in JSX. We'll all be rejoicing when pattern matching finally lands in JS [1]. [1] https://github.com/tc39/proposal-pattern-matching
comment by jakelazaroff · 2023-09-22 · in Second-Guessing the Modern Web (2020) -
…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 .
comment by graftak · 2023-08-18 · in TypeScript is surprisingly ok for compilers -
The proposal for pattern matching syntax seems more akin to what they're looking for. https://github.com/tc39/proposal-pattern-matching
comment by graftak · 2023-08-18 · in TypeScript is surprisingly ok for compilers -
Both are active tc39 proposals :) https://github.com/tc39/proposal-pipeline-operator - Stage 2 https://github.com/tc39/proposal-pattern-matching - Stage 1 Hopefully we get both in the next couple of years.
comment by bern4444 · 2023-03-22 · in Mostly adequate guide to FP (in JavaScript) -
https://github.com/tc39/proposal-pattern-matching I'm not sure if it's stalled or not. But it's being discussed.
comment by Waterluvian · 2023-03-21 · in Java 20 / JDK 20: General Availability -
…without waiting. We've added https://github.com/tc39/proposal-pipeline-operator , a variant of https://github.com/tc39/proposal-pattern-matching , a variant of https://github.com/tc39/proposal-string-dedent and others. Since our goal is to…
comment by Yahivin · 2023-02-28 · in CoffeeScript for TypeScript -
…and pattern matching have been proposed to JS. https://github.com/tc39/proposal-pipeline-operator https://github.com/tc39/proposal-pattern-matching
comment by tacotacotaco · 2023-01-02 · in Functional Programming – How and Why -
For reference. Pattern matching: https://github.com/tc39/proposal-pattern-matching Do expression: https://github.com/tc39/proposal-do-expressions Pipe operator: https://github.com/tc39/proposal-pipeline-operator
comment by gherkinnn · 2022-10-04 · in The TC39 Process -
…actually being discussed in tc39 for JS as a whole (where TS reps are some of the champions, ofc): https://github.com/tc39/proposal-pattern-matching The specifics of the proposal will likely shift a bit since it's still stage 1 (2?).
comment by wwwigham · 2022-10-01 · in Ten Years of TypeScript -
…There are two Stage 1 TC39 proposals with different approaches to it: More hands-on/direct: https://github.com/tc39/proposal-pattern-matching More indirect: https://github.com/tc39/proposal-do-expressions > list comprehensions There are…
comment by WorldMaker · 2022-07-28 · in HypeScript: Simplified TypeScript type system in TypeScript's own type system -
…Typescript do not has proper pattern matching support, The proposal is far from being adopted https://github.com/tc39/proposal-pattern-matching > Related, Typescript is the only language I know of that through flow analysis does not…
comment by SemanticStrengh · 2022-05-14 · in Java record pattern matching in JDK 19 -
I think they are great! Especially in combination with pattern matching ( https://github.com/tc39/proposal-pattern-matching ), or when using JSX.
comment by lucacasonato · 2021-12-13 · in Deno Joins TC39 -
That is a stage 1 proposal[1]. [1] https://github.com/tc39/proposal-pattern-matching
comment by graftak · 2021-09-07 · in V8 Release v9.4 -
…1 proposals that I hope get in there some day. https://github.com/tc39/proposal-slice-notation https://github.com/tc39/proposal-pattern-matching
comment by Joeri · 2021-06-28 · in JavaScript Is Weird -
Hopefully we will get real pattern-matching at some point ( https://github.com/tc39/proposal-pattern-matching ), but I kinda sorta like this!
comment by scotttrinh · 2021-04-12 · in Using the switch(true) pattern in JavaScript -
…presented to TC-39. If it reaches Stage 3 then it is presumed likely Typescript will implement it. https://github.com/tc39/proposal-pattern-matching
comment by WorldMaker · 2021-03-10 · in Why Become a TypeScript Fan? -
https://github.com/tc39/proposal-pattern-matching
comment by chiffre · 2020-08-04 · in Learn Functional Programming Design from Redux -
…for adding it to Javascript (using the keyword `case`, like the non-popular language Haskell)? https://github.com/tc39/proposal-pattern-matching At what point does a feature go from "horrible code" to "stealing each others' best ideas"?…
comment by chriswarbo · 2020-07-27 · in Named arguments are coming in PHP 8 -
…fac(N) when N > 0 -> N*fac(N-1). This makes a lot of code much more readable and more concise. [1] https://github.com/tc39/proposal-pattern-matching [2] http://cr.openjdk.java.net/~briangoetz/amber/pattern-match.h...
comment by dmitriid · 2020-02-19 · in Intro To Pattern Matching – Covers C# 9 -
Pattern matching seems to be a current proposal, also driven by Microsoft: https://github.com/tc39/proposal-pattern-matching
comment by Fannon · 2020-02-02 · in TypeScript’s quirks: How inconsistencies make the language more complex -
…could just get pattern matching[1] and optional chaining[2], that would really elevate things. [1] https://github.com/tc39/proposal-pattern-matching [2] https://github.com/tc39/proposal-optional-chaining
comment by halfmatthalfcat · 2019-07-30 · in What’s New in ES2019 -
…but once they settle on the actual syntax, i'd feel comfortable to start using it with compilers. https://github.com/tc39/proposal-pattern-matching
comment by Klathmon · 2019-03-11 · in “No, we’re telling everyone we are using Java” -
…pattern matching! It's currently a stage 1 proposal with backing from Microsoft, npm, and Facebook. https://github.com/tc39/proposal-pattern-matching
comment by bastawhiz · 2019-02-22 · in Why I prefer objects over switch statements -
This might be our best hope right now: https://github.com/tc39/proposal-pattern-matching
comment by alexsasharegan · 2019-02-02 · in Pattern Matching Custom Data Types in TypeScript -
…(some people use if statements, some switch, and others store it all in an object and use keys). 1. https://github.com/tc39/proposal-pattern-matching#motivating...
comment by dvdhnt · 2018-04-25 · in JavaScript Pattern Matching Proposal -
…to javascript to support this has been proposed, I'm hopeful that it gets considered seriously: https://github.com/tc39/proposal-pattern-matching
comment by brentjanderson · 2018-02-27 · in How I Learned to Stop Worrying and Love the State Machine -
It's just become a Stage 0 proposal: https://github.com/tc39/proposal-pattern-matching
comment by herrschnapps · 2017-07-13 · in Toward Go 2 -
TC39 published its stage 0 proposal for pattern matching in ECMAScript a couple of days ago: https://github.com/tc39/proposal-pattern-matching
comment by stupidcar · 2017-07-05 · in Pattern Matching with TypeScript