aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2023-01-07 01:23:30 +0530
committerAkshay Nair <phenax5@gmail.com>2023-01-07 01:23:30 +0530
commit92956b4d5c330690f85be95185a1c6ef99094111 (patch)
tree9d05571bf36d3ebed22813dce1800dea6685ed50 /README.md
parent88df16e6550688201e13dfd56acb5fcb1a7537d3 (diff)
downloadts-types-lang-92956b4d5c330690f85be95185a1c6ef99094111.tar.gz
ts-types-lang-92956b4d5c330690f85be95185a1c6ef99094111.zip
docs: readme
Diffstat (limited to '')
-rw-r--r--README.md32
1 files changed, 28 insertions, 4 deletions
diff --git a/README.md b/README.md
index 901e4ee..8a749a3 100644
--- a/README.md
+++ b/README.md
@@ -1,13 +1,37 @@
-# TS Types lang
-A stupid runtime for TS types!
+# TS Types lang [WIP]
+A runtime for ts types that turns it into a general purpose pure functional programming language!
-Take a look at the [./examples][./examples] directory for examples on how to write a program in typescript types
+Take a look at the [./examples](./examples) directory for examples on how to write a program in typescript types
+
+
+### Example
+
+```typescript
+import { PutString, Bind, Kind1, ReadLine, Do } from 'ts-types-lang/stdlib'
+
+// :: string -> Effect ()
+interface GreetK extends Kind1<string> {
+ return: Do<[
+ PutString<"Hello, ">,
+ PutString<`${this['input']}\n`>
+ ]>,
+}
+
+// main :: [Effect ()] | Effect ()
+export type main = [
+ PutString<"Your name? ">,
+ Bind<ReadLine, GreetK>,
+]
+```
To run it -
```bash
-npx ts-types-lang ./examples/guess-number.ts
+npx tsr ./examples/guess-number.ts
+// OR
+yarn exec tsr ./examples/guess-number.ts
```
+
### Why?
I dunno