mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-21 15:28:15 +03:00
16 lines
409 B
Plaintext
16 lines
409 B
Plaintext
--State1 ability
|
|
structural ability State se2 where
|
|
put : ∀ se . se -> {State se} ()
|
|
get : ∀ se . () -> {State se} se
|
|
|
|
-- state : ∀ s a . s -> Request (State s) a -> (s, a)
|
|
state woot = cases
|
|
{ State.put snew -> k } -> handle k () with state snew
|
|
{ State.get () -> k } -> handle k woot with state woot
|
|
{ a } -> (woot, a)
|
|
|
|
blah : ∀ s a . s -> Request (State s) a -> (s, a)
|
|
blah = state
|
|
|
|
> ()
|