aboutsummaryrefslogtreecommitdiff
path: root/examples/hello-world.ts
blob: fcdb8e9d6f413d45e7ea4dc7aab358132c4ba863 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { Bind, Do, Kind1 } from "../stdlib/effect";
import { CreateRef, GetRef, Ref, SetRef } from "../stdlib/ref";
import { Print } from "../stdlib/stdio";

interface PrintK extends Kind1 {
  return: Print<this['input']>
}

interface Func extends Kind1<Ref> {
  return: Do<[
    SetRef<this['input'], 69>,
    Bind<GetRef<this['input']>, PrintK>,
  ]>
}

export type main = [
  Bind<CreateRef<200>, Func>,
  Print<1>,
]