This module Defines the asynchronous monadic interface for Lake. The interface is composed of three major abstract monadic types:
m
: The monad of the synchronous action (e.g.,IO
).n
: The monad of the (a)synchronous task manager (e.g.,BaseIO
).k
: The monad of the (a)synchronous task (e.g.,IOTask
).
The definitions within this module provide the basic utilities for converting between these monads and combining them in different ways.
Async / Await Abstraction #
Standard Instances #
Combinators #
- bindSync : {α β : Type u} → Task.Priority → k α → (α → m β) → n (k β)
Perform a synchronous action after another (a)synchronous task completes successfully.
Instances
Instances
Standard Instances #
List/Array Utilities #
Sequencing (A)synchronous Tasks #
Combine all (a)synchronous tasks in a List
from right to left into a single task ending last
.
Equations
- Lake.seqLeftList1Async last [] = pure last
- Lake.seqLeftList1Async last (t :: ts) = do let x ← Lake.seqLeftList1Async t ts Lake.seqLeftAsync last x
Instances For
Folding (A)synchronous Tasks #
Fold a List
of (a)synchronous tasks from right to left (i.e., a right fold) into a single task.
Instances For
Fold an Array
of (a)synchronous tasks from right to left (i.e., a right fold) into a single task.
Instances For
Fold a List
of (a)synchronous tasks from left to right (i.e., a left fold) into a single task.
Instances For
Fold an Array
of (a)synchronous tasks from left to right (i.e., a left fold) into a single task.