mirror of
https://github.com/unisonweb/unison.git
synced 2024-10-04 21:57:25 +03:00
23 lines
393 B
Plaintext
23 lines
393 B
Plaintext
--IO/State2 effect
|
|
effect IO where
|
|
launch-missiles : {IO} ()
|
|
|
|
foo : () -> {IO} ()
|
|
foo unit =
|
|
inc-by : Int -> {IO, State Int} ()
|
|
inc-by i =
|
|
IO.launch-missiles -- OK, since declared by `inc-by` signature
|
|
y = State.get
|
|
State.put (y Int.+ i)
|
|
()
|
|
|
|
type Optional a =
|
|
Some a | None
|
|
|
|
effect State se2 where
|
|
put : ∀ se . se -> {State se} ()
|
|
get : ∀ se . {State se} se
|
|
|
|
()
|
|
|