aboutsummaryrefslogtreecommitdiff
path: root/src/stdlib/io.ts
blob: 00b74b1315358817602c7ba018bfc4edd9bd5401 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
export interface EffectAtom<T = unknown> { output: T }
export type Effect = EffectAtom[]

export interface Kind1<Inp = unknown, Out = unknown> {
  input: Inp
  return: Out
}

export interface Program<Effs extends Effect, ExitCode extends number = 0> {
  effects: Effs,
  exitCode: ExitCode,
}

export interface Bind<Eff extends EffectAtom, Fn extends Kind1> extends EffectAtom {
  input: Eff
  chainTo: Fn
}