blob: 25c9c859145c1e9df31c6ba0e5b4423d0ebba400 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
# TS Types lang
A runtime for typescript's **type system** that turns it into a **general purpose**, **purely functional** programming language with effects!
### 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 } from 'ts-types-lang/stdlib/effect'
import { PutString, PutStringLn, ReadLine } from 'ts-types-lang/stdlib/stdio'
export type main = [
PutString<"Your name? ">,
// Read a line from stdin and then greet
Bind<ReadLine, <name extends string>() =>
PutStringLn<`Hello, ${name}`>>,
]
```
### 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
yarn exec tsr run ./examples/guess-number.ts
```
### FAQ
#### Why?
I dunno
#### How?
I dunno
#### What?
I dunno
|