aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2023-01-15 00:13:04 +0530
committerAkshay Nair <phenax5@gmail.com>2023-01-15 00:13:04 +0530
commitd5c3af89ab8076bcf4107859c1ba6b47a7815142 (patch)
tree1da469a7007fe2cfced0647ae62c1cd003a3fa0d /README.md
parente75a5a15912b8f297fe9c9747f574486d6c4e334 (diff)
downloadts-types-lang-d5c3af89ab8076bcf4107859c1ba6b47a7815142.tar.gz
ts-types-lang-d5c3af89ab8076bcf4107859c1ba6b47a7815142.zip
chore: some more documentation
Diffstat (limited to 'README.md')
-rw-r--r--README.md44
1 files changed, 30 insertions, 14 deletions
diff --git a/README.md b/README.md
index 2cf14cc..25c9c85 100644
--- a/README.md
+++ b/README.md
@@ -1,36 +1,52 @@
-# TS Types lang [WIP]
-A runtime for typescript's **type system** that turns it into a **general purpose**, **purely functional** programming language!
+# TS Types lang
+A runtime for typescript's **type system** that turns it into a **general purpose**, **purely functional** programming language with effects!
-Take a look at the [./examples](./examples) directory for examples on how to write a program in typescript types
+### Documentation
+- [stdlib reference](./docs/modules.md)
+- [examples](./examples/)
### Example
+Take a look at the [./examples](./examples) directory for more examples on how to write a program in typescript types
+
```typescript
-import { Bind, Kind1, Do } from 'ts-types-lang/stdlib/effect'
+import { Bind } from 'ts-types-lang/stdlib/effect'
import { PutString, PutStringLn, ReadLine } from 'ts-types-lang/stdlib/stdio'
-// :: string -> Effect ()
-interface GreetK extends Kind1<string> {
- return: PutString<`Hello, ${this['input']}`>,
-}
-
-// main :: [Effect ()] | Effect ()
export type main = [
PutString<"Your name? ">,
- Bind<ReadLine, GreetK>,
+ // Read a line from stdin and then greet
+ Bind<ReadLine, <name extends string>() =>
+ PutStringLn<`Hello, ${name}`>>,
]
```
-To run it -
+### Run a types-lang module
+
+Install it -
+```bash
+npm i --save ts-types-lang
+# OR
+yarn add ts-types-lang
+```
+
+Or just run it -
```bash
npx tsr run ./examples/guess-number.ts
-// OR
+# OR
yarn exec tsr run ./examples/guess-number.ts
```
-### Why?
+### FAQ
+
+#### Why?
+I dunno
+
+#### How?
+I dunno
+#### What?
I dunno