Equations
- IO.AsyncList.instInhabited = { default := IO.AsyncList.nil }
Equations
- IO.AsyncList.instAppend = { append := IO.AsyncList.append }
Equations
- IO.AsyncList.instCoeList = { coe := IO.AsyncList.ofList }
A stateful step computation f
is applied iteratively, forming an async
stream. The stream ends once f
returns none
for the first time.
For cooperatively cancelling an ongoing computation, we recommend referencing
a cancellation token in f
and checking it when appropriate.
Equations
- IO.AsyncList.unfoldAsync f init = do let tInit ← (IO.AsyncList.unfoldAsync.step f init).asTask pure (IO.AsyncList.delayed tInit)
Spawns a Task
waiting on all elements.
Equations
- IO.AsyncList.waitAll = IO.AsyncList.waitUntil fun (x : α) => false
Spawns a Task
acting like List.find?
but which will wait for tail evaluation
when necessary to traverse the list. If the tail terminates before a matching element
is found, the task throws the terminating value.