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
|
import { Bind, BindTo, Do, Kind1, Label } from '../stdlib/effect'
import { PutStringLn } from '../stdlib/stdio'
import { ReadFile } from '../stdlib/fs'
import { Try } from '../stdlib/exception'
interface PrintK extends Kind1<string> {
return: PutStringLn<this['input']>
}
export type main = [
Do<
[
BindTo<'contents', ReadFile<'./bin.js'>>,
PutStringLn<'------'>,
Bind<Label<'contents'>, <c extends string>() => PutStringLn<c>>
]
>,
Try<
Bind<Label<'contents'>, PrintK>,
<e extends string>() => PutStringLn<`ERROR: ${e}`>
>,
PutStringLn<'-------------'>,
Bind<ReadFile<'./default.nix'>, <c extends string>() => PutStringLn<c>>,
PutStringLn<'-------------'>,
Try<
Bind<ReadFile<'./unicorn'>, PrintK>,
<M extends string>() => PutStringLn<`ERROR: ${M}`>
>
]
|