std/os/task▲toc

Experimental: Parallel tasks.

Note: very experimental and may not work as intended :-) See test/bench/koka/binarytrees.kk for example usage.

type lvarstd/os/task/lvar: V -> V<a>
fun get( lvar : lvarstd/os/task/lvar: V -> V<a>, bot : a, is-gte : (a, a) -> boolstd/core/types/bool: V ) : purestd/core/pure: E a
fun put( lvar : lvarstd/os/task/lvar: V -> V<a>, x : a, monotonic-combine : (a, a) -> a ) : purestd/core/pure: E ()
type promisestd/os/task/promise: V -> V<a>

A promisestd/os/task/promise: V -> V<a> can be awaited for a result.

Await the result of a promise.

Spark a pure computation in a separate thread of control.

fun list/await( ps : liststd/core/types/list: V -> V<promisestd/os/task/promise: V -> V<a>> ) : purestd/core/pure: E liststd/core/types/list: V -> V<a>

Await the result of a list of promises.

fun parallel( xs : liststd/core/types/list: V -> V<() -> purestd/core/pure: E a> ) : purestd/core/pure: E liststd/core/types/list: V -> V<a>

Run a list of pure computations in parallel.

fun task-set-default-concurrency( thread-count : intstd/core/types/int: V ) : iostd/core/io: E ()
private import std/core/typesstd/core/types, std/core/hndstd/core/hnd, std/core/exnstd/core/exn, std/core/boolstd/core/bool, std/core/orderstd/core/order, std/core/charstd/core/char, std/core/intstd/core/int, std/core/vectorstd/core/vector, std/core/stringstd/core/string, std/core/sslicestd/core/sslice, std/core/liststd/core/list, std/core/maybestd/core/maybe, std/core/eitherstd/core/either, std/core/tuplestd/core/tuple, std/core/showstd/core/show, std/core/debugstd/core/debug, std/core/delayedstd/core/delayed, std/core/consolestd/core/console, std/corestd/core, std/num/int32std/num/int32