let map f v = let l = v.length in let r = create l false in for i = 0 to l - 1 do unsafe_set r i (f (unsafe_get v i)) done; r