Skip to content

Commit e45c923

Browse files
committed
[doc] backport some readme improvements from v4
1 parent 3c3aebf commit e45c923

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ Write **better** and **safer conditions**. Pattern matching lets you express com
5353

5454
## What is Pattern Matching?
5555

56-
Pattern Matching is a technique coming from functional programming languages to declaratively write conditional code branches based on the structure of a value. This technique has proven itself to be much more powerful and much less verbose than imperative alternatives (if/else/switch statements) especially when branching on complex data structures or on several values.
56+
Pattern Matching is a code-branching technique coming from functional programming languages, which let you scrutinize the structure of values in a declarative way. It has proven itself to be less verbose and more powerful than imperative alternatives (if/else/switch statements), especially when branching on complex data structures or on several values.
5757

58-
Pattern Matching is implemented in Haskell, Rust, Swift, Elixir and many other languages. There is [a tc39 proposal](https://github.com/tc39/proposal-pattern-matching) to add Pattern Matching to the EcmaScript specification, but it is still in stage 1 and isn't likely to land before several years (if ever). Luckily, pattern matching can be implemented in userland. `ts-pattern` Provides a typesafe pattern matching implementation that you can start using today.
58+
Pattern Matching is implemented in Haskell, Rust, Swift, Elixir and many other languages. There is [a tc39 proposal](https://github.com/tc39/proposal-pattern-matching) to add Pattern Matching to the EcmaScript specification, but it is still in stage 1 and isn't likely to land before several years. Luckily, pattern matching can be implemented in userland. `ts-pattern` Provides a typesafe pattern matching implementation that you can start using today.
5959

6060
Read the introduction blog post: [Bringing Pattern Matching to TypeScript 🎨 Introducing TS-Pattern v3.0](https://dev.to/gvergnaud/bringing-pattern-matching-to-typescript-introducing-ts-pattern-v3-0-o1k)
6161

@@ -75,6 +75,8 @@ yarn add ts-pattern
7575

7676
### compatibility with different TypeScript versions
7777

78+
Note: TS-Pattern assumes [Strict Mode](https://www.typescriptlang.org/tsconfig#strict) is enabled in your `tsconfig.json` file.
79+
7880
| ts-pattern | TypeScript v4.2+ | TypeScript v4.1+ | TypeScript v3.x- |
7981
| ---------- | ---------------- | ---------------- | ---------------- |
8082
| v3.x || ⚠️ ||
@@ -95,6 +97,7 @@ yarn add ts-pattern
9597
- [`match`](#match)
9698
- [`.with`](#with)
9799
- [`.when`](#when)
100+
- [`.exhaustive`](#exhaustive)
98101
- [`.otherwise`](#otherwise)
99102
- [`.run`](#run)
100103
- [`isMatching`](#ismatching)

0 commit comments

Comments
 (0)