mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-25 01:08:30 +03:00
17 lines
361 B
Plaintext
17 lines
361 B
Plaintext
--IO/State2 effect
|
|
effect IO where
|
|
launch-missiles : {IO} ()
|
|
effect State se2 where
|
|
put : ∀ se . se -> {State se} ()
|
|
get : ∀ se . {State se} se
|
|
foo : () -> {IO} ()
|
|
foo unit =
|
|
inc-by : Int64 -> {IO, State Int64} ()
|
|
inc-by i =
|
|
IO.launch-missiles -- OK, since declared by `inc-by` signature
|
|
y = State.get
|
|
State.put (y Int64.+ i)
|
|
()
|
|
()
|
|
|