version_bump/task
A minimal cross-target async abstraction.
Task(a) is a deferred computation yielding an a. On the JavaScript target
it is backed by a Promise; on the Erlang/BEAM target there are no promises,
so it is simply the eagerly-computed value (an identity “monad”). The
combinators have target-specific FFI implementations (version_bump_task_ffi.erl and
version_bump_task_ffi.mjs) so the rest of the pipeline can sequence asynchronous work
— chiefly the GitHub HTTP request — without caring which target it compiles
for.
On Erlang every combinator runs immediately and synchronously; on JavaScript they defer onto the microtask/promise queue.
Types
Values
pub fn await(task: Task(a), then f: fn(a) -> Task(b)) -> Task(b)
Chain a task-producing function onto a task (monadic bind / promise “then”).