Enum.frequencies_by
You're seeing just the function
frequencies_by
, go back to Enum module for more information.
Specs
Returns a map with keys as unique elements given by key_fun
and values
as the count of every element.
Examples
iex> Enum.frequencies_by(~w{aa aA bb cc}, &String.downcase/1)
%{"aa" => 2, "bb" => 1, "cc" => 1}
iex> Enum.frequencies_by(~w{aaa aA bbb cc c}, &String.length/1)
%{3 => 2, 2 => 2, 1 => 1}