Enum.frequencies_by

You're seeing just the function frequencies_by, go back to Enum module for more information.
Link to this function

frequencies_by(enumerable, key_fun)

View Source (since 1.10.0)

Specs

frequencies_by(t(), (element() -> any())) :: map()

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}