tur/effects
stdlib/effects.tur
defmacro
with-write
(with-write [body])
handle the Write effect by printing to stdout via println.
Parameters
| body | the expression whose Write effects are handled |
Since: Phase 19
defmacro
with-fail-panic
(with-fail-panic [body])
handle the Fail effect by panicking with the message.
Parameters
| body | the expression whose Fail effects are handled |
Since: Phase 19
defmacro
with-getenv
(with-getenv [body])
handle the GetEnv effect by delegating to C getenv(3).
Parameters
| body | the expression whose GetEnv effects are handled |
Since: Phase 19
defn
read-int-console
(read-int-console :int)
read a single integer from stdin via scanf.
Since: Phase 19
defmacro
with-read-console
(with-read-console [body])
handle the Read effect by reading an integer from stdin.
Parameters
| body | the expression whose Read effects are handled |
Since: Phase 19
defmacro
with-stderr-log
(with-stderr-log [body])
handle the Log effect by printing all messages to stdout.
Parameters
| body | the expression whose Log effects are handled |
Since: Phase 19
defmacro
with-silent-log
(with-silent-log [body])
handle the Log effect by suppressing all log output.
Parameters
| body | the expression whose Log effects are handled |
Since: Phase 19
defmacro
with-abort-panic
(with-abort-panic [body])
handle the Abort effect by panicking with the message.
Parameters
| body | the expression whose Abort effects are handled |
Since: Phase 19
defmacro
with-async
(with-async [body])
handle the Async effect by running the thunk and resuming with its result.
Parameters
| body | the expression whose Async effects are handled |
Since: Phase T25
defmacro
with-await
(with-await [body])
handle the Await effect by blocking until the future resolves.
Parameters
| body | the expression whose Await effects are handled |
Since: Phase T25