blob: 1f82e4f8c49b1f4d42ad61cf6df3a732248e2cbc (
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
|
# TS Types lang [WIP]
A runtime for ts types that turns it into a general purpose, purely functional programming language!
Take a look at the [./examples](./examples) directory for examples on how to write a program in typescript types
### Example
```typescript
import { PutString, PutStringLn, Bind, Kind1, ReadLine, Do } from 'ts-types-lang/stdlib'
// :: string -> Effect ()
interface GreetK extends Kind1<string> {
return: Do<[
PutString<"Hello, ">,
PutStringLn<this['input']>
]>,
}
// main :: [Effect ()] | Effect ()
export type main = [
PutString<"Your name? ">,
Bind<ReadLine, GreetK>,
]
```
To run it -
```bash
npx tsr ./examples/guess-number.ts
// OR
yarn exec tsr ./examples/guess-number.ts
```
### Why?
I dunno
|