aboutsummaryrefslogtreecommitdiff
path: root/examples/file.ts
blob: fd5728b42a54ff03f4a7ffeb94a9661d9a9517cf (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
import { Bind, Kind1 } 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']>
}

interface ConstK<Val> extends Kind1<unknown, Val> {
  return: Val
}

export type main = [
  Bind<ReadFile<'./default.nix'>, PrintK>,
  Bind<
    Try<
      ReadFile<'./unicorn'>,
      ConstK<"hello world">
    >,
    PrintK
  >,
]