Skip to content

Commit

Permalink
added goal example
Browse files Browse the repository at this point in the history
  • Loading branch information
azizghuloum committed Nov 25, 2024
1 parent 409298c commit a2fff5d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Term Rewrite System for TypeScript

# Goals

## Ability to define pattern matching

```typescript
type T = { type: "num"; num: number } | { type: "str"; str: string };

const x: T = { type: "num", num: 17 };

match(x, [
[{ type: "num", num: n }, n + n],
[{ type: "str", str: s }, s.length],
]);
```

# Progress

## basic expressions, statements, and declarations
Expand Down

0 comments on commit a2fff5d

Please sign in to comment.