aboutsummaryrefslogtreecommitdiff
path: root/examples/hello-world.ts
blob: 9d2bc18dfc6fc3bf5ab78be2b193e4de738dc757 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
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>]