mirror of
https://github.com/unisonweb/unison.git
synced 2024-11-10 20:00:27 +03:00
18 lines
297 B
Plaintext
18 lines
297 B
Plaintext
--State2 ability
|
|
structural ability State s where
|
|
put : s -> {State s} ()
|
|
|
|
state : s -> Request (State s) a -> a
|
|
state s = cases
|
|
{ State.put snew -> k } -> handle k () with state snew
|
|
{ a } -> a
|
|
|
|
ex : Text
|
|
ex = handle
|
|
State.put (11 + 1)
|
|
State.put (5 + 5)
|
|
"hello"
|
|
with state 10
|
|
|
|
> ex
|