unison/unison-src/tests/state2b-min.u
2021-08-24 11:33:27 -07:00

16 lines
292 B
Plaintext

--State2 ability
structural ability State s where
put : s -> {State s} ()
state : s -> Request (State s) a -> s
state s = cases
{ State.put snew -> k } -> handle k () with state snew
{ a } -> s
> handle
State.put (11 + 1)
State.put (5 + 15)
()
with state 10
-- should be 20