Skip to main content

Module thunk

Module thunk 

Source
Expand description

Thunk (evaluated on first get) and Task (run synchronously when created; there are no worker threads).

Functions§

lean_io_as_task⚠
BaseIO.asTask act prio (act, prio consumed): runs act now.
lean_io_bind_task⚠
BaseIO.bindTask t f prio sync (t, f, prio consumed).
lean_io_cancel⚠
IO.cancel : @& Task α → BaseIO Unit.
lean_io_cancel_core⚠
IO.cancel: no-op, tasks are already finished.
lean_io_check_canceled⚠
IO.checkCanceled : BaseIO Bool.
lean_io_check_canceled_core⚠
IO.checkCanceled: tasks are never canceled.
lean_io_get_task_state⚠
IO.getTaskState : @& Task α → BaseIO TaskState.
lean_io_get_task_state_core⚠
IO.getTaskState: finished (2), or running (1) for the result of an unresolved promise, as the C runtime reports it.
lean_io_map_task⚠
BaseIO.mapTask f t prio sync (f, t, prio consumed).
lean_io_promise_new⚠
IO.Promise.new : BaseIO (Promise α): a promise whose task Task (Option α) holds no value until resolve (some v) or until the promise is dropped (none).
lean_io_promise_resolve⚠
IO.Promise.resolve : α → (@& Promise α) → BaseIO Unit (consumes value); a second resolve keeps the first value.
lean_io_promise_result_opt⚠
IO.Promise.result? : (@& Promise α) → Task (Option α).
lean_io_wait⚠
IO.wait : Task α → BaseIO α (consumes t).
lean_io_wait_any⚠
IO.waitAny : @& List (Task α) → BaseIO α: the value of the first task.
lean_mk_thunk⚠
Thunk.mk from a closure Unit → α (consumed).
lean_option_get_or_block⚠
Option.getOrBlock! : Option α → α (consumes o): the value, or a panic for a promise dropped without a value.
lean_task_bind⚠
Task.bind x f prio sync (x, f, prio consumed).
lean_task_bind_core⚠
lean_task_get⚠
The value of a task (borrowed in and out).
lean_task_get_own⚠
Task.get (consumes t).
lean_task_map⚠
Task.map f t prio sync (f, t, prio consumed).
lean_task_map_core⚠
lean_task_pure⚠
Task.pure (consumes a).
lean_task_spawn⚠
Task.spawn (c and prio consumed).
lean_task_spawn_core⚠
Runs the closure c : Unit → α (consumed) now and returns the finished task.
lean_thunk_get⚠
The value of t (borrowed in and out).
lean_thunk_get_core⚠
Evaluates the closure of t and stores the value; returns it borrowed.
lean_thunk_get_own⚠
Thunk.get (borrows t, returns an owned value).
lean_thunk_pure⚠
Thunk.pure (consumes v).