fn map(list: [T], f: fn(T) -> R) -> [R] { out := [] for v in list.iter() { out.append(f(v)) } return out }