map.scp (452B)
1 !export map 2 -- Apply a supplied worker to each list element, preserving order and length. 3 -- Input: a list; state: the worker descriptor. `call` uses that worker's 4 -- initial state, so calls do not thread mutable state between elements. 5 -- A failed worker call fails the whole map. Example: map with wrap sends 6 -- [1 2] to [[1] [2]]. 7 consumer map 8 [] @ _ => [] 9 [x | xs] @ worker => call worker x as mapped in [mapped | recur xs @ worker]