unison/unison-src/errors/state4.u
2021-08-24 11:33:27 -07:00

14 lines
304 B
Plaintext

--State4 ability
structural ability State se2 where
put : ∀ se . se -> {State se} ()
get : ∀ se . () -> {State se} se
-- binding is not guarded by a lambda, it only can access
-- ambient abilities (which will be empty)
ex1 : {State Int} ()
ex1 =
y = State.get
State.put (y Int.+ +1)
()
()