Releases: elixir-lang/elixir
Releases · elixir-lang/elixir
v0.10.3
Enhancements
- [Enum] Add
Enum.take_every/2 - [IEx] IEx now respects signals sent from the Ctrl+G menu
- [Kernel] Allow documentation for types with
@typedoc - [Mix] Allow apps to be selected in umbrella projects
- [Record] Generated record functions
newandupdatealso take options with strings as keys - [Stream] Add
Stream.unfold/1
Bug fixes
- [Dict] Fix a bug when a HashDict was marked as equal when one was actually a subset of the other
- [EEx] Solve issue where
doblocks inside templates were not properly aligned - [ExUnit] Improve checks and have better error reports on poorly aligned doctests
- [Kernel] Fix handling of multiple heredocs on the same line
- [Kernel] Provide better error messages for match, guard and quoting errors
- [Kernel] Make
Kernel.raise/2a macro to avoid messing up stacktraces - [Kernel] Ensure
&()works on quoted blocks with only one expression - [Mix] Address an issue where a dependency was not compiled in the proper order when specified in different projects
- [Mix] Ensure
compile: falseis a valid mechanism for disabling the compilation of dependencies - [Regex] Fix bug on
Regex.scan/3when capturing groups and the regex has no groups - [String] Fix a bug with
String.split/2when given an empty pattern - [Typespec] Guarantee typespecs error reports point to the proper line
Deprecations
- [Kernel] The previous partial application syntax (without the
&operator) has now been deprecated - [Regex]
Regex.captures/3is deprecated in favor ofRegex.named_captures/3 - [String]
String.valid_codepoint?/1is deprecated in favor of pattern matching with<<_ :: utf8 >>
Backwards incompatible changes
- [IEx] The
r/0helper has been removed as it caused surprising behaviour when many modules with dependencies were accumulated - [Mix]
Mix.Versionwas renamed toVersion - [Mix]
File.IteratorErrorwas renamed toIO.StreamError - [Mix]
mix newnow defaults to the--supoption, use--bareto get the previous behaviour
v0.10.2
Enhancements
- [CLI] Add
--verboseto elixirc, which now is non-verbose by default - [Dict] Add
Dict.Behaviouras a convenience to create your own dictionaries - [Enum] Add
Enum.split/2,Enum.reduce/2,Enum.flat_map/2,Enum.chunks/2,Enum.chunks/4,Enum.chunks_by/2,Enum.concat/1andEnum.concat/2 - [Enum] Support negative indices in
Enum.at/fetch/fetch! - [ExUnit] Show failures on CLIFormatter as soon as they pop up
- [IEx] Allow for strings in
hhelper - [IEx] Helpers
randccan handle erlang sources - [Integer] Add
odd?/1andeven?/1 - [IO] Added support to specifying a number of bytes to stream to
IO.stream,IO.binstream,File.stream!andFile.binstream! - [Kernel] Include file and line on error report for overriding an existing function/macro
- [Kernel] Convert external functions into quoted expressions. This allows record fields to contain functions as long as they point to an
&Mod.fun/arity - [Kernel] Allow
foo?andbar!as valid variable names - [List] Add
List.replace_at/3 - [Macro] Improve printing of the access protocol on
Macro.to_string/1 - [Macro] Add
Macro.to_string/2to support annotations on the converted string - [Mix] Automatically recompile a project if the Elixir version changes
- [Path] Add
Path.relative_to_cwd/2 - [Regex] Allow erlang
reoptions when compiling Elixir regexes - [Stream] Add
Stream.concat/1,Stream.concat/2andStream.flat_map/2 - [String] Add regex pattern support to
String.replace/3 - [String] Add
String.ljust/2,String.rjust/2,String.ljust/3andString.rjust/3 - [URI]
URI.parse/1supports IPv6 addresses
Bug fixes
- [Behaviour] Do not compile behaviour docs if docs are disabled on compilation
- [ExUnit] Doctests no longer eat too much space and provides detailed reports for poorly indented lines
- [File] Fix a bug where
File.touch(file, datetime)was not setting the proper datetime when the file did not exist - [Kernel] Limit
inspectresults to 50 items by default to avoid printing too much data - [Kernel] Return a readable error on oversized atoms
- [Kernel] Allow functions ending with
?or!to be captured - [Kernel] Fix default shutdown of child supervisors to
:infinity - [Kernel] Fix regression when calling a function/macro ending with bang, followed by
do/endblocks - [List] Fix bug on
List.insert_at/3that added the item at the wrong position for negative indexes - [Macro]
Macro.escape/2can now escape improper lists - [Mix] Fix
Mix.Versionmatching on pre-release info - [Mix] Ensure
watch_extstrigger full recompilation on change withmix compile - [Mix] Fix regression on
mix clean --all - [String]
String.strip/2now supports removing unicode characters - [String]
String.slice/3still returns the proper result when there is no length to be extracted - [System]
System.get_env/0now returns a list of tuples as previously advertised
Deprecations
- [Dict]
Dict.update/3is deprecated in favor ofDict.update!/3 - [Enum]
Enum.min/2andEnum.max/2are deprecated in favor ofEnum.min_by/2andEnum.max_by/2 - [Enum]
Enum.join/2andEnum.map_join/3with a char list are deprecated - [IO]
IO.stream(device)andIO.binstream(device)are deprecated in favor ofIO.stream(device, :line)andIO.binstream(device, :line) - [Kernel]
list_to_binary/1,binary_to_list/1andbinary_to_list/3are deprecated in favor ofString.from_char_list!/1andString.to_char_list!/1for characters and:binary.list_to_bin/1,:binary.bin_to_list/1and:binary.bin_to_list/3for bytes - [Kernel]
to_binary/1is deprecated in favor ofto_string/1 - [Kernel] Deprecate
def/4and friends in favor ofdef/2with unquote and friends - [Kernel] Deprecate
%band%Bin favor of%sand%S - [List]
List.concat/2is deprecated in favor ofEnum.concat/2 - [Macro]
Macro.unescape_binary/1andMacro.unescape_binary/2are deprecated in favor ofMacro.unescape_string/1andMacro.unescape_string/2 - [Mix]
:umbrellaoption for umbrella paths has been deprecated in favor of:in_umbrella
Backwards incompatible changes
- [IO] IO functions now only accept iolists as arguments
- [Kernel]
Binary.Charswas renamed toString.Chars - [Kernel] The previous ambiguous import syntax
import :functions, Foowas removed in favor ofimport Foo, only: :functions - [OptionParser]
parseandparse_headnow returns a tuple with three elements instead of two
v0.10.1
Enhancements
- [Behaviour] Add support for
defmacrocallback/1 - [Enum] Add
Enum.shuffle/1 - [ExUnit] The
:traceoption now also reports run time for each test - [ExUnit] Add support for
:colorto enable/disable ANSI coloring - [IEx] Add the
clearhelper to clear the screen. - [Kernel] Add the capture operator
& - [Kernel] Add support for
GenFSM.Behaviour - [Kernel] Functions now points to the module and function they were defined when inspected
- [Kernel] A documentation attached to a function that is never defined now prints warnings
- [List] Add
List.keysort/2 - [Mix]
:test_helperproject configuration did not affectmix testand was therefore removed. Atest/test_helper.exsfile is still necessary albeit it doesn't need to be automatically required in each test file - [Mix] Add manifests for yecc, leex and Erlang compilers, making it easier to detect dependencies in between compilers and providing a more useful clean behaviour
- [Mix]
mix helpnow outputs information about the default mix task - [Mix] Add
--no-deps-checkoption tomix run,mix compileand friends to not check dependency status - [Mix] Add support for
MIX_GIT_FORCE_HTTPSsystem environment that forces HTTPS for known providers, useful when the regular git port is blocked. This configuration does not affect themix.lockresults - [Mix] Allow coverage tool to be pluggable via the
:test_coverageconfiguration - [Mix] Add
mix cmdas a convenience to run a command recursively in child apps in an umbrella application - [Mix] Support
umbrella: truein dependencies as a convenience for setting up umbrella path deps - [Mix]
mix runnow behaves closer to theelixircommand and properly mangles the ARGV - [String] Add
Regex.scan/3now supports capturing groups - [String] Add
String.reverse/1
Bug fix
- [Behaviour] Ensure callbacks are stored in the definition order
- [CLI] Speed up boot time on Elixir .bat files
- [IEx] Reduce cases where IEx parser can get stuck
- [Kernel] Improve error messages when the use of an operator has no effect
- [Kernel] Fix a bug where warnings were not being generated when imported macros conflicted with local functions or macros
- [Kernel] Document that
on_definitioncan only be a function as it is evaluated inside the function context - [Kernel] Ensure
%wsigils with no interpolation are fully expanded at compile time - [Mix]
mix deps.update,mix deps.cleanandmix deps.unlockno longer change all dependencies unless--allis given - [Mix] Always run
mix loadpathsonmix app.start, even if--no-compileis given - [OptionParser] Do not add boolean flags to the end result if they were not given
- [OptionParser] Do not parse non-boolean flags as booleans when true or false are given
- [OptionParser] Ensure
:keepand:integer|:floatcan be given together as options - [OptionParser] Ensure
--no-flagsets:flagto false when:flagis a registered boolean switch
Deprecations
- [Kernel]
function(Mod.fun/arity)andfunction(fun/arity)are deprecated in favor of&Mod.fun/arityand&fun/arity - [Kernel]
function/3is deprecated in favor ofModule.function/3 - [Kernel]
Kernel.ParallelCompilernow receives a set of callbacks instead of a single one - [Mix]
:test_coverageoption now expect keywords arguments and the--coverflag is now treated as a boolean
Backwards incompatible changes
- [Regex]
Regex.scan/3now always returns a list of lists, normalizing the result, instead of list with mixed lists and binaries - [System]
System.halt/2was removed since the current Erlang implementation of such function is bugged
v0.10.0
Enhancements
- [ExUnit] Support
trace: trueoption which gives detailed reporting on test runs - [HashDict] Optimize
HashDictto store pairs in a cons cell reducing storage per key by half - [Kernel] Add pretty printing support for inspect
- [Kernel] Add document algebra library used as the foundation for pretty printing
- [Kernel] Add
defrecordp/3that enables specifying the first element of the tuple - [Kernel] Add the
SetAPI and a hash based implementation viaHashSet - [Kernel] Add
Streamas composable, lazy-enumerables - [Mix]
mix archivenow includes the version of the generated archive - [Mix] Mix now requires explicit dependency overriding to be given with
override: true - [Mix] Projects can now define an
:elixirkey to outline supported Elixir versions - [Typespec] Improve error messages to contain file, line and the typespec itself
Bug fix
- [CLI] Elixir can now run on Unix directories with
:in its path - [Kernel]
match?/2does not leak variables to outer scope - [Kernel] Keep
head|tailformat when splicing at the tail - [Kernel] Ensure variables defined in the module body are not passed to callbacks
- [Mix] On dependencies conflict, show from where each source is coming from
- [Mix] Empty projects no longer leave empty ebin files on
mix compile - [Module] Calling
Module.register_attribute/3no longer automatically changes it to persisted or accumulated
Deprecations
- [Enum] Receiving the index of iteration in
Enum.map/2andEnum.each/2is deprecated in favor ofStream.with_index/1 - [File]
File.iterator/1andFile.biniterator/1are deprecated in favor ofIO.stream/1andIO.binstream/1 - [File]
File.iterator!/2andFile.biniterator!/2are deprecated in favor ofFile.stream!/2andFile.binstream!/2 - [Kernel] Deprecate recently added
quote binding: ...in favor of the clearerquote bind_quoted: ... - [Kernel] Deprecate
Kernel.float/1in favor of a explicit conversion - [Mix] Deprecate
mix run EXPRin favor ofmix run -e EXPR - [Record]
Record.__index__/2deprecated in favor ofRecord.__record__(:index, key)
Backwards incompatible changes
-
[Kernel] The
Binary.Inspectprotocol has been renamed toInspect -
[Kernel] Tighten up the grammar rules regarding parentheses omission, previously the examples below would compile but now they raise an error message:
do_something 1, is_list [], 3 [1, is_atom :foo, 3] -
[Module] Calling
Module.register_attribute/3no longer automatically changes it to persisted or accumulated -
[Record] First element of a record via
defrecordpis now thedefrecordpname and no longer the current atom -
[URI] Remove custom URI parsers in favor of
URI.default_port/2