Created
March 5, 2020 08:31
-
-
Save samvv/a6883d4aae42cd5d1a2745c00e1058ce to your computer and use it in GitHub Desktop.
Hypothetical Pattern Matching in TypeScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function fac(n: number) { | |
| return match (n) { | |
| 1 | 0 => 1, | |
| _ => n * fac(n-1), | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment