diff options
| author | Akshay Nair <phenax5@gmail.com> | 2023-01-07 01:23:30 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2023-01-07 01:23:30 +0530 |
| commit | 92956b4d5c330690f85be95185a1c6ef99094111 (patch) | |
| tree | 9d05571bf36d3ebed22813dce1800dea6685ed50 /README.md | |
| parent | 88df16e6550688201e13dfd56acb5fcb1a7537d3 (diff) | |
| download | ts-types-lang-92956b4d5c330690f85be95185a1c6ef99094111.tar.gz ts-types-lang-92956b4d5c330690f85be95185a1c6ef99094111.zip | |
docs: readme
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 32 |
1 files changed, 28 insertions, 4 deletions
@@ -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 |
