Skip to content

Releases: elixir-lang/elixir

v0.12.1

04 Jan 09:43
Compare
Choose a tag to compare
v0.12.1 Pre-release
Pre-release

Enhancements

  • [ExUnit] Support :include and :exclude configuration options to filter which tests should run based on their tags. Those options are also supported via mix test as --include and --exclude
  • [ExUnit] Allow doctests to match against #MyModule<>

Bug fixes

  • [CLI] Abort when a pattern given to elixirc does not match any file
  • [Float] Fix Float.parse/1 to handle numbers of the form "-0.x"
  • [IEx] Improve error message for IEx.Helpers.r when module does not exist
  • [Mix] Ensure deps.get updates origin if lock origin and dep origin do not match
  • [Mix] Use relative symlinks in _build
  • [Typespec] Fix conversion of unary ops from typespec format to ast
  • [Typespec] Fix handling of tuple() and {}

Deprecations

  • [Kernel] Do not leak clause heads. Previously, a variable defined in a case/receive head clauses would leak to the outer scope. This behaviour is deprecated and will be removed in the next release.
  • [Kernel] Deprecate __FILE__ in favor of __DIR__ or __ENV__.file

Backwards incompatible changes

  • [GenFSM] GenServer now stops on unknown event/sync_event requests
  • [GenServer] GenServer now stops on unknown call/cast requests
  • [Kernel] Change how -> is represented in AST. Now each clause is represented by its own AST node which makes composition easier. See commit 51aef55 for more information.

v0.12.0

15 Dec 22:14
Compare
Choose a tag to compare
v0.12.0 Pre-release
Pre-release

Enhancements

  • [Exception] Allow exception/1 to be overriden and promote it as the main mechanism to customize exceptions
  • [File] Add File.stream_to!/3
  • [Float] Add Float.floor/1, Float.ceil/1 and Float.round/3
  • [Kernel] Add List.delete_at/2 and List.updated_at/3
  • [Kernel] Add Enum.reverse/2
  • [Kernel] Implement defmodule/2, @/1, def/2 and friends in Elixir itself. case/2, try/2 and receive/1 have been made special forms. var!/1, var!/2 and alias!/1 have also been implemented in Elixir and demoted from special forms
  • [Record] Support dynamic fields in defrecordp
  • [Stream] Add Stream.resource/3
  • [Stream] Add Stream.zip/2, Stream.filter_map/3, Stream.each/2, Stream.take_every/2, Stream.chunk/2, Stream.chunk/3, Stream.chunk/4, Stream.chunk_by/2, Stream.scan/2, Stream.scan/3, Stream.uniq/2, Stream.after/2 and Stream.run/1
  • [Stream] Support Stream.take/2 and Stream.drop/2 with negative counts

Bug fixes

  • [HashDict] Ensure a HashDict stored in an attribute can be accessed via the attribute
  • [Enum] Fix bug in Enum.chunk/4 where you'd get an extra element when the enumerable was a multiple of the counter and a pad was given
  • [IEx] Ensure c/2 helper works with full paths
  • [Kernel] quote location: :keep now only affects definitions in order to keep the proper trace in definition exceptions
  • [Mix] Also symlink include directories in _build dependencies
  • [Version] Fix Version.match?/2 with ~> and versions with alphanumeric build info (like -dev)

Deprecations

  • [Enum] Enumerable.count/1 and Enumerable.member?/2 should now return tagged tuples. Please see Enumerable docs for more info
  • [Enum] Deprecate Enum.chunks/2, Enum.chunks/4 and Enum.chunks_by/2 in favor of Enum.chunk/2, Enum.chunk/4 and Enum.chunk_by/2
  • [File] File.binstream!/3 is deprecated. Simply use File.stream!/3 which is able to figure out if stream or binstream operations should be used
  • [Macro] Macro.extract_args/1 is deprecated in favor of Macro.decompose_call/1

Backwards incompatible changes

  • [Enum] Behaviour of Enum.drop/2 and Enum.take/2 has been switched when given negative counts
  • [Enum] Behaviour of Enum.zip/2 has been changed to stop as soon as the first enumerable finishes
  • [Enum] Enumerable.reduce/3 protocol has changed to support suspension. Please see Enumerable docs for more info
  • [Mix] Require :escript_main_module to be set before generating escripts
  • [Range] Range.Iterator protocol has changed in order to work with the new Enumerable.reduce/3. Please see Range.Iterator docs for more info
  • [Stream] The Stream.Lazy structure has changed to accumulate functions and accumulators as we go (its inspected representation has also changed)
  • [Typespec] when clauses were moved to the outer part of the spec and should be in the keywords format. So add(a, b) when is_subtype(a, integer) and is_subtype(b, integer) :: integer should now be written as add(a, b) :: integer when a: integer, b: integer

v0.11.2

14 Nov 11:51
Compare
Choose a tag to compare
v0.11.2 Pre-release
Pre-release

Enhancements

  • [Mix] Add mix iex that redirects users to the proper iex -S mix command
  • [Mix] Support build_per_environment: true in project configuration that manages a separete build per environment, useful when you have per-environment behaviour/compilation

Backwards incompatible changes

  • [Mix] Mix now compiles files to _build. Projects should update just fine, however documentation and books may want to update to the latest information

v0.11.1

07 Nov 17:47
Compare
Choose a tag to compare
v0.11.1 Pre-release
Pre-release

Enhancements

  • [Mix] Improve dependency convergence by explicitly checking each requirement instead of expecting all requirements to be equal
  • [Mix] Support optional dependencies with optional: true. Optional dependencies are downloaded for the current project but they are automatically skipped when such project is used as a dependency

Bug fixes

  • [Kernel] Set compilation status per ParallelCompiler and not globally
  • [Mix] Ensure Mix does not load previous dependencies versions before deps.get/deps.update
  • [Mix] Ensure umbrella apps are sorted before running recursive commands
  • [Mix] Ensure umbrella apps run in the same environment as the parent project
  • [Mix] Ensure dependency tree is topsorted before compiling
  • [Mix] Raise error when duplicated projects are pushed into the stack
  • [URI] Allow lowercase escapes in URI

Deprecations

  • [Mix] Setting :load_paths in your project configuration is deprecated

v0.11.0

02 Nov 09:30
Compare
Choose a tag to compare
v0.11.0 Pre-release
Pre-release

Enhancements

  • [Code] Eval now returns variables from other contexts
  • [Dict] Document and enforce all dicts use the match operator (===) when checking for keys
  • [Enum] Add Enum.slice/2 with a range
  • [Enum] Document and enforce Enum.member?/2 to use the match operator (===)
  • [IEx] Split IEx.Evaluator from IEx.Server to allow custom evaluators
  • [IEx] Add support for IEx.pry which halts a given process for inspection
  • [IO] Add specs and allow some IO APIs to receive any data that implements String.Chars
  • [Kernel] Improve stacktraces on command line interfaces
  • [Kernel] Sigils can now handle balanced tokens as in %s(f(o)o)
  • [Kernel] Emit warnings when an alias is not used
  • [Macro] Add Macro.pipe/3 and Macro.unpipe/1 for building pipelines
  • [Mix] Allow umbrella children to share dependencies between them
  • [Mix] Allow mix to be escriptize'd
  • [Mix] Speed mix projects compilation by relying on more manifests information
  • [Protocol] Protocols now provide impl_for/1 and impl_for!/1 functions which receive a structure and returns its respective implementation, otherwise returns nil or an error
  • [Set] Document and enforce all sets use the match operator (===) when checking for keys
  • [String] Update to Unicode 6.3.0
  • [String] Add String.slice/2 with a range

Bug fixes

  • [Exception] Ensure defexception fields can be set dynamically
  • [Kernel] Guarantee aliases hygiene is respected when the current module name is not known upfront
  • [Kernel] Kernel.access/2 no longer flattens lists
  • [Mix] Ensure cyclic dependencies are properly handled
  • [String] Implement the extended grapheme cluster algorithm for String operations

Deprecations

  • [Kernel] pid_to_list/1, list_to_pid/1, binary_to_atom/2, binary_to_existing_atom/2 and atom_to_binary/2 are deprecated in favor of their counterparts in the :erlang module
  • [Kernel] insert_elem/3 and delete_elem/2 are deprecated in favor of Tuple.insert_at/3 and Tuple.delete_at/2
  • [Kernel] Use of in inside matches (as in x in [1,2,3] -> x) is deprecated in favor of the guard syntax (x when x in [1,2,3])
  • [Macro] Macro.expand_all/2 is deprecated
  • [Protocol] @only and @except in protocols are now deprecated
  • [Protocol] Protocols no longer fallback to Any out of the box (this functionality needs to be explicitly enabled by setting @fallback_to_any to true)
  • [String] String.to_integer/1 and String.to_float/1 are deprecated in favor of Integer.parse/1 and Float.parse/1

Backwards incompatible changes

  • [CLI] Reading .elixirrc has been dropped in favor of setting env vars
  • [Kernel] Kernel.access/2 now expects the second argument to be a compile time list
  • [Kernel] fn -> end quoted expression is no longer wrapped in a do keyword
  • [Kernel] Quoted variables from the same module must be explicitly shared. Previously, if a function returned quote do: a = 1, another function from the same module could access it as quote do: a. This has been fixed and the variables must be explicitly shared with var!(a, __MODULE__)
  • [Mix] Umbrella apps now treat children apps as dependencies. This means all dependencies will be checked out in the umbrela deps directory. On upgrade, child apps need to point to the umbrella project by setting deps_path: "../../deps_path", lockfile: "../../mix.lock" in their project config
  • [Process] Process.group_leader/2 args have been reversed so the "subject" comes first
  • [Protocol] Protocol no longer dispatches to Number, but to Integer and Float

v0.10.3

02 Oct 19:01
Compare
Choose a tag to compare
v0.10.3 Pre-release
Pre-release

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 new and update also 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 do blocks 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/2 a 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: false is a valid mechanism for disabling the compilation of dependencies
  • [Regex] Fix bug on Regex.scan/3 when capturing groups and the regex has no groups
  • [String] Fix a bug with String.split/2 when 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/3 is deprecated in favor of Regex.named_captures/3
  • [String] String.valid_codepoint?/1 is deprecated in favor of pattern matching with <<_ :: utf8 >>

Backwards incompatible changes

  • [IEx] The r/0 helper has been removed as it caused surprising behaviour when many modules with dependencies were accumulated
  • [Mix] Mix.Version was renamed to Version
  • [Mix] File.IteratorError was renamed to IO.StreamError
  • [Mix] mix new now defaults to the --sup option, use --bare to get the previous behaviour

v0.10.2

03 Sep 18:08
Compare
Choose a tag to compare
v0.10.2 Pre-release
Pre-release
Enhancements
  • [CLI] Add --verbose to elixirc, which now is non-verbose by default
  • [Dict] Add Dict.Behaviour as 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/1 and Enum.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 h helper
  • [IEx] Helpers r and c can handle erlang sources
  • [Integer] Add odd?/1 and even?/1
  • [IO] Added support to specifying a number of bytes to stream to IO.stream, IO.binstream, File.stream! and File.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? and bar! 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/2 to 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 re options when compiling Elixir regexes
  • [Stream] Add Stream.concat/1, Stream.concat/2 and Stream.flat_map/2
  • [String] Add regex pattern support to String.replace/3
  • [String] Add String.ljust/2, String.rjust/2, String.ljust/3 and String.rjust/3
  • [URI] URI.parse/1 supports 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 inspect results 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/end blocks
  • [List] Fix bug on List.insert_at/3 that added the item at the wrong position for negative indexes
  • [Macro] Macro.escape/2 can now escape improper lists
  • [Mix] Fix Mix.Version matching on pre-release info
  • [Mix] Ensure watch_exts trigger full recompilation on change with mix compile
  • [Mix] Fix regression on mix clean --all
  • [String] String.strip/2 now supports removing unicode characters
  • [String] String.slice/3 still returns the proper result when there is no length to be extracted
  • [System] System.get_env/0 now returns a list of tuples as previously advertised
Deprecations
  • [Dict] Dict.update/3 is deprecated in favor of Dict.update!/3
  • [Enum] Enum.min/2 and Enum.max/2 are deprecated in favor of Enum.min_by/2 and Enum.max_by/2
  • [Enum] Enum.join/2 and Enum.map_join/3 with a char list are deprecated
  • [IO] IO.stream(device) and IO.binstream(device) are deprecated in favor of IO.stream(device, :line) and IO.binstream(device, :line)
  • [Kernel] list_to_binary/1, binary_to_list/1 and binary_to_list/3 are deprecated in favor of String.from_char_list!/1 and String.to_char_list!/1 for characters and :binary.list_to_bin/1, :binary.bin_to_list/1 and :binary.bin_to_list/3 for bytes
  • [Kernel] to_binary/1 is deprecated in favor of to_string/1
  • [Kernel] Deprecate def/4 and friends in favor of def/2 with unquote and friends
  • [Kernel] Deprecate %b and %B in favor of %s and %S
  • [List] List.concat/2 is deprecated in favor of Enum.concat/2
  • [Macro] Macro.unescape_binary/1 and Macro.unescape_binary/2 are deprecated in favor of Macro.unescape_string/1 and Macro.unescape_string/2
  • [Mix] :umbrella option 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.Chars was renamed to String.Chars
  • [Kernel] The previous ambiguous import syntax import :functions, Foo was removed in favor of import Foo, only: :functions
  • [OptionParser] parse and parse_head now returns a tuple with three elements instead of two

v0.10.1

03 Aug 16:24
Compare
Choose a tag to compare
v0.10.1 Pre-release
Pre-release
Enhancements
  • [Behaviour] Add support for defmacrocallback/1
  • [Enum] Add Enum.shuffle/1
  • [ExUnit] The :trace option now also reports run time for each test
  • [ExUnit] Add support for :color to enable/disable ANSI coloring
  • [IEx] Add the clear helper 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_helper project configuration did not affect mix test and was therefore removed. A test/test_helper.exs file 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 help now outputs information about the default mix task
  • [Mix] Add --no-deps-check option to mix run, mix compile and friends to not check dependency status
  • [Mix] Add support for MIX_GIT_FORCE_HTTPS system environment that forces HTTPS for known providers, useful when the regular git port is blocked. This configuration does not affect the mix.lock results
  • [Mix] Allow coverage tool to be pluggable via the :test_coverage configuration
  • [Mix] Add mix cmd as a convenience to run a command recursively in child apps in an umbrella application
  • [Mix] Support umbrella: true in dependencies as a convenience for setting up umbrella path deps
  • [Mix] mix run now behaves closer to the elixir command and properly mangles the ARGV
  • [String] Add Regex.scan/3 now 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_definition can only be a function as it is evaluated inside the function context
  • [Kernel] Ensure %w sigils with no interpolation are fully expanded at compile time
  • [Mix] mix deps.update, mix deps.clean and mix deps.unlock no longer change all dependencies unless --all is given
  • [Mix] Always run mix loadpaths on mix app.start, even if --no-compile is 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 :keep and :integer|:float can be given together as options
  • [OptionParser] Ensure --no-flag sets :flag to false when :flag is a registered boolean switch
Deprecations
  • [Kernel] function(Mod.fun/arity) and function(fun/arity) are deprecated in favor of &Mod.fun/arity and &fun/arity
  • [Kernel] function/3 is deprecated in favor of Module.function/3
  • [Kernel] Kernel.ParallelCompiler now receives a set of callbacks instead of a single one
  • [Mix] :test_coverage option now expect keywords arguments and the --cover flag is now treated as a boolean
Backwards incompatible changes
  • [Regex] Regex.scan/3 now always returns a list of lists, normalizing the result, instead of list with mixed lists and binaries
  • [System] System.halt/2 was removed since the current Erlang implementation of such function is bugged

v0.10.0

15 Jul 09:37
Compare
Choose a tag to compare
v0.10.0 Pre-release
Pre-release
Enhancements
  • [ExUnit] Support trace: true option which gives detailed reporting on test runs
  • [HashDict] Optimize HashDict to 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/3 that enables specifying the first element of the tuple
  • [Kernel] Add the Set API and a hash based implementation via HashSet
  • [Kernel] Add Stream as composable, lazy-enumerables
  • [Mix] mix archive now 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 :elixir key 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?/2 does not leak variables to outer scope
  • [Kernel] Keep head|tail format 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/3 no longer automatically changes it to persisted or accumulated
Deprecations
  • [Enum] Receiving the index of iteration in Enum.map/2 and Enum.each/2 is deprecated in favor of Stream.with_index/1
  • [File] File.iterator/1 and File.biniterator/1 are deprecated in favor of IO.stream/1 and IO.binstream/1
  • [File] File.iterator!/2 and File.biniterator!/2 are deprecated in favor of File.stream!/2 and File.binstream!/2
  • [Kernel] Deprecate recently added quote binding: ... in favor of the clearer quote bind_quoted: ...
  • [Kernel] Deprecate Kernel.float/1 in favor of a explicit conversion
  • [Mix] Deprecate mix run EXPR in favor of mix run -e EXPR
  • [Record] Record.__index__/2 deprecated in favor of Record.__record__(:index, key)
Backwards incompatible changes
  • [Kernel] The Binary.Inspect protocol has been renamed to Inspect

  • [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/3 no longer automatically changes it to persisted or accumulated

  • [Record] First element of a record via defrecordp is now the defrecordp name and no longer the current atom

  • [URI] Remove custom URI parsers in favor of URI.default_port/2

v0.9.3

01 Sep 15:44
Compare
Choose a tag to compare
v0.9.3 Pre-release
Pre-release
Release v0.9.3