context demo.agt

type Id = opaque Int where NonNegative

agent Counter {
  key id: Id

  store n: Cell[Int]

  on call increment() -> Effect[Int] {
    let cur = n
    n := cur + 1
    Effect.pure(cur + 1)
  }
}
