From d5c3af89ab8076bcf4107859c1ba6b47a7815142 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 15 Jan 2023 00:13:04 +0530 Subject: chore: some more documentation --- docs/README.md | 44 ++++++++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 14 deletions(-) (limited to 'docs/README.md') diff --git a/docs/README.md b/docs/README.md index c38000c..c52b415 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,35 +1,51 @@ ts-types-lang / [Modules](modules.md) -# 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 { - return: PutString<`Hello, ${this['input']}`>, -} - -// main :: [Effect ()] | Effect () export type main = [ PutString<"Your name? ">, - Bind, + // Read a line from stdin and then greet + Bind() => + 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 -- cgit v1.3.1