// transpiled from Go by mx-transpile - review TODOs before use package example func worker(id int, results chan<- int) { results <- id * id } func fanOut() { results := make(chan int) for i := 0; i < 4; i++ { spawn worker(i, results) } for i := 0; i < 4; i++ { <-results } } func background(fn func()) { spawn fn() } func pipeline() { ch := make(chan []byte) spawn func() { ch <- "hello" }() msg := <-ch _ = msg }