def par.answers

snap@1.4.0.0 · src/par.bend:63

import snap@1.4.0.0/src/par.bend as Par
import Base

63# every job's answer: each status paired with the body at its place in the
64# order, or with none when there is no body there
65def par.answers(cs: List<&2, String>, bodies: List<&2, Maybe<&2, String>>) -> List<&2, String>:
66  match cs bodies:
67    case Nil{} _bs:
68      []
69    case Con{+code, ct} Nil{}:
70      par.of(code, None{}) <> par.answers(ct, [])
71    case Con{+code, ct} Con{body, bt}:
72      par.of(code, body) <> par.answers(ct, bt)

Uses (4)

Used by (1)