~c"\t", "file2" => ~c"\v"} Why do number 9 and 11 get converted to the corresponding ASCII code ~c"\t" and ~c"" /> ~c"\t", "file2" => ~c"\v"} Why do number 9 and 11 get converted to the corresponding ASCII code ~c"\t" and ~c"" /> ~c"\t", "file2" => ~c"\v"} Why do number 9 and 11 get converted to the corresponding ASCII code ~c"\t" and ~c""/>

Elixir Enum.group_by converts integers to ASCII Chars

51 views Asked by At

The following code returns

%{"file1" => ~c"\t", "file2" => ~c"\v"}

Why do number 9 and 11 get converted to the corresponding ASCII code ~c"\t" and ~c"\v"? And how can I make 9 and 11 be in the output?

diagnostics = [
  %{file: "file1", position: 9},
  %{file: "file2", position: 11}
]

diagnostics
|> Enum.group_by(&Map.get(&1, :file), &Map.get(&1, :position))
0

There are 0 answers