mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-17 13:27:30 +03:00
16 lines
292 B
Plaintext
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
|