Removes a call that transforms its first argument and returns that argument instead.
The following calls are supported at every available arity:
Enum.sort/Enum.sort_by/Enum.reverse/Enum.shuffleEnum.uniq/Enum.uniq_by/Enum.dedup/Enum.dedup_byEnum.intersperseStream.uniq/Stream.uniq_by/Stream.dedup/Stream.dedup_by/Stream.intersperseList.flattenMap.delete/Map.drop/Map.take, and the correspondingKeywordcallsList.delete/List.delete_at/List.keydeleteString.trim/String.trim_leading/String.trim_trailingString.downcase/String.upcase/String.capitalizeString.reverse/String.normalize/String.replace_invalidString.pad_leading/String.pad_trailing/String.slice/String.byte_sliceURI.encode_www_form/URI.decode_www_formNaiveDateTime.beginning_of_day/NaiveDateTime.end_of_dayDate.beginning_of_month/Date.end_of_month/Date.beginning_of_week/Date.end_of_weekKernel.abs(abs(x)→x)Kernel.binary_slice/2,3,Kernel.binary_part/3, and:erlang.binary_part/2,3- the corresponding Erlang
:stringtransforms —trim/strip/chomp,lowercase/uppercase/titlecase/casefold/to_lower/to_upper,reverse,pad/left/right/centre,slice/substr/sub_string
The list is limited to calls whose first argument and result have compatible types. Slicing calls are included because returning the whole input remains type-compatible. Calls such as map, filter, reduce, replace, and split are excluded.
A regular call is replaced by its first argument: Enum.sort(xs) becomes xs. A pipe stage is replaced by Function.identity/1. Guard-safe removals, such as abs(x), also apply inside guards.
This family is enabled by default. It matches aliased and imported calls, including Erlang modules. Bare Kernel calls match only at their defined arities, so a same-named local function is not removed.