tur/effects

stdlib/effects.tur
defmacro

with-write

(with-write [body])

handle the Write effect by printing to stdout via println.

bodythe 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.

bodythe 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).

bodythe 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.

bodythe 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.

bodythe 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.

bodythe 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.

bodythe 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.

bodythe 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.

bodythe expression whose Await effects are handled

Since: Phase T25