Function.identity
You're seeing just the function
identity
, go back to Function module for more information.
Specs
identity(value) :: value when value: var
Returns its input value
. This function can be passed as an anonymous function
to transformation functions.
Examples
iex> Function.identity("Hello world!")
"Hello world!"
iex> 'abcdaabccc' |> Enum.sort() |> Enum.chunk_by(&Function.identity/1)
['aaa', 'bb', 'cccc', 'd']
iex> Enum.group_by('abracadabra', &Function.identity/1)
%{97 => 'aaaaa', 98 => 'bb', 99 => 'c', 100 => 'd', 114 => 'rr'}
iex> Enum.map([1, 2, 3, 4], &Function.identity/1)
[1, 2, 3, 4]