Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Inline more regularly used functions in the standard Elixir modules to their Erlang STDLIB counterparts:
Float.to_charlist/1
Float.to_string/1
List.duplicate/2
List.flatten/1
List.flatten/2
Map.from_keys/2
Map.merge/3
Great care was taken to ensure function guards already applied to the Elixir functions were subsets of the function guards in Erlang's STDLIB.
For example,Map.merge/3
specified the combiner function must beis_function(fun, 3)
and Erlang's:maps.merge_with
also already specifies that argument must beis_function(Combiner, 3)
.The one exception to the above is the inlining of
Float.to_charlist/1
andFloat.to_string/1
. The Elixir functions specified that the argument must be a float withis_float(float)
and thus will raise aFunctionClauseError
exception if e.g. an integer is passed, while:erlang.float_to_list/2
and:erlang.float_to_binary/2
will instead throw anArgumentError
exception. However, changing to the Erlang behavior brings those functions more in line with the behavior of the rest of the Elixir modules, e.g.Atom.to_charlist/1
,Atom.to_string/1
,Integer.to_charlist/1
andInteger.to_string/1
will all throw anArgumentError
exception on an unexpected argument type.