proc map(str: string, fun: (char) -> char): string =
  for c in str:
    result &= fun(c)