Enhancement
73 changes
Add Application.fetch_env!/2, Application.loaded_applications/0 and Application.started_applications/0
Add support for --werl in Windows bash-like shells
Add Dict.get_and_update/3 which behaves similar to the now deprecated Access protocol
Add Dict.get_lazy/3, Dict.pop_lazy/3 and Dict.put_new_lazy/3
Add Enum.random/1, Enum.take_random/2, Enum.min_max/1, Enum.min_max_by/2, Enum.reverse_slice/3, Enum.reduce_while/3, Enum.dedup/1 and Enum.dedup_by/2
Inline common map usage in Enum functions for performance
Add File.lstat/1 and File.lstat/1 that works like File.stat/1 but is able to return symlink information (i.e. it does not traverse symlinks)
Add File.rename/2
Add Integer.digits/2 and Integer.undigits/2
Add the :safe option to inspect/2 and make it safe by default, meaning failures while inspecting won't trigger other failures. Instead, it will be wrapped in an exception which is properly formatted
Support fenced code blocks on IO.ANSI.Docs
Add GenServer.whereis/1 that expands GenServer dispatches into a proper pid
No longer include :crypto and :syntax_tools as dependencies. The former is only needed if you have encrypted debug info (therefore you can add :crypto as a dependency manually) and the latter is no longer used
Raise when var.Alias syntax is used and it does not expand to an atom at compile time (previously it emitted warnings)
Improve generation of argument names for function signatures
::/2 is now a special form
Warn when a variable with underscore is used
Allow underscores in binary, octal and hex literals
Warn when module attributes, variables, strings and numbers are used in code but the expression has no effect
Support \uXXXX and \u{X*} in strings and char lists to map to Unicode codepoints
Add List.keytake/3
Improve name inference for function signatures in documentation metadata
Add Process.hibernate/3
Allow a list of specs in Process.info/2
Introduce MapSet data type. This new data type uses maps behind the scenes and is useful for storing a dozens of items in Erlang 17. In future versions when maps efficiently support large collections, it is meant to be the main Set abstraction in Elixir
Add Stream.dedup/1, Stream.dedup_by/2 and Stream.transform/4
Support calculation of the jaro distance between strings (usually names) via String.jaro_distance/2. This is used by Mix to support "Did you mean?" feature when a task does not exist
Add String.splitter/3 that splits strings as a stream
StringIO.flush/1 was added to flush the output of a StringIO device
Introduce Task.yield/2 and Task.shutdown/2 to check if a task is still executing and shutdown otherwise
Add Tuple.append/2
Default ports were added for "ws" and "wss" schemas
Add URI.to_string/1
Add :trim option to EEx that automatically trims the left side of <% and right side %> if only spaces and new lines preceed/follow them
Add number of skipped tests to ExUnit output
Make timeout configurable for the whole test suite via the :timeout configuration
Allow moduledoc to be filtered/skipped in doctests
Provide built-in log capturing functionality
Allow assert_receive_timeout and refute_receive_timeout to be configured in the ExUnit application
Allow tests to be skipped with @tag :skip or @tag skip: "reason"
Add tests without implementation (missing the do block) which automatically fail. Such tests are also automatically tagged as :not_implemented, allowing them to be skipped
Increase by default stacktrace depth to 20 (this value is also configurable)
Improve formatting on assert_raise errors for message mismatch
Improve formatting on assert_receive when using pinned variables
Support IEx.pry with --remsh for remote debugging
Add b/1 helper that shows documentation for behaviour modules and its callback functions
Provide tab completion for aliases and allow aliases like Foo.Bar.Baz to autocomplete even if Foo.Bar is not defined
Provide a pid/3 helper for buildings pids from numbers
Support printing pids and refs in Logger metadata
Allow Logger metadata to be removed from pdict by setting it to nil
Add application configuration translator_inspect_opts for logger to customize how state and message are formatted when translating OTP errors and reports
Automatically include the current application in metadata when compiled via Mix
Check Elixir version right after archive installation and provide feedback if there is a mismatch
Allow rebar dependencies with mix.exs to be compiled with Mix
Allow rebar dependencies to be specified via :path
Also consider subdirectories in config directory for Mix.Project.config_files/0
Allow dynamic configuration in Mix projects by storing config in an agent
Support rebar3 style Git refs in rebar.config files
Only recompile compile time dependencies in mix projects. This should considerably speed up recompilation times in Elixir projects
Warn when configuring an application that is not available
Add mix profile.fprof for easy code profiling
Abort when dependencies have conflicting :only definitions
Fully recompile projects if Elixir or SCM changes
Allow checksum to be checked on archive install via --sha512 option
Add mix local.public_keys to safely manage installation of Hex and Rebar dependencies
The module Behaviour is deprecated. Instead of defcallback, one can simply use @callback. Instead of defmacrocallback, one can simply use @macrocallback
Enum.uniq/2 is deprecated in favor of Enum.uniq_by/2
\x inside strings and charlists is deprecated in favor of \uXXXX and \u{X*}. The values emitted by \x are unfortunately wrong (they should be bytes but currently it emits codepoints). \u is meant to correctly map to codepoints and \x will be fixed in the future to map to bytes
Ungreedy option r is deprecated in favor of U (which is standard in regular expressions in other languages)
Implementing the Access protocol is deprecated. The Access protocol relies on the code server in development and test mode (when protocol consolidation is not applied) and it generated a bottleneck when working with multiple processes and the Access protocol was invoked hundreds of times (which is not uncommon). Note the Access module and the opts[key] syntax are not affected and they are not deprecated, only the underlying protocol dispatch
?\xHEX is deprecated in favor of 0xHEX. There is no situation where the former should be used in favor of the latter and the latter is always cleaner
Giving as: true | false to alias/2 and require/2 have been deprecated (it was undocumented behaviour)
Passing an empty string to starts_with?, contains? and ends_with? had dubious behaviour and have been deprecated to help developers identify possible bugs in their source code