Elixir release

1.4.0

Change breakdown

Organization at a glance

Detailed changelog

Enhancement

64 changes

Tool: Elixir Module: Calendar

Add Date.compare/2, Time.compare/2, NaiveDateTime.compare/2 and DateTime.compare/2

Tool: Elixir Module: Calendar

Support NaiveDateTime.add/3 and NaiveDateTime.diff/3 for adding seconds (up to microseconds) as well as the difference between two NaiveDateTimes in seconds (up to microseconds)

Tool: Elixir Module: Calendar

Add Date.leap_year?/1 and Date.day_of_week/1

Tool: Elixir Module: Calendar

Ensure Date, Time and NaiveDateTime APIs work with any struct that provides the same set of fields as their respective struct. For example, a NaiveDateTime can be given to Date since it contains a superset of the fields in the Date struct

Tool: Elixir Module: Enum

Add Enum.map_every/2 that invokes the given function with every nth item

Tool: Elixir Module: Enum

Add min/2, max/2, min_max/2, min_by/3, max_by/3, and min_max_by/3 that allow a function specifying the default value when the enumerable is empty

Tool: Elixir Module: Enum

Introduce Enum.zip/1 to zip multiple entries at once

Tool: Elixir Module: Float

Introduce Float.ratio/1 that returns a tuple with the numerator and denominator as integers to retrieve the given float

Tool: Elixir Module: GenServer

Log warn on default handle_info/2 implementation

Tool: Elixir Module: Inspect

Support syntax coloring via the :syntax_color option

Tool: Elixir Module: Integer

Integer.digits/2 now accepts negative integers

Tool: Elixir Module: Integer

Add Integer.mod/2 and Integer.floor_div/2

Tool: Elixir Module: IO

Add :label option to IO.inspect/2 to help distinguish multiple IO.inspect/2 calls.

Tool: Elixir Module: Kernel

Recognize merge conflict markers in source and provide a readable error message

Tool: Elixir Module: Kernel

Warn on unused module attributes

Tool: Elixir Module: Kernel

Improve compiler message on unexpected end of line

Tool: Elixir Module: Kernel

Raise BadBooleanError when a non-boolean is given on the left-hand side of and/or

Tool: Elixir Module: List

Add List.pop_at/3

Tool: Elixir Module: List

Add List.myers_difference/2

Tool: Elixir Module: OptionParser

Expand multi-letter aliases in OptionParser

Tool: Elixir Module: Process

Add Process.send_after/4

Tool: Elixir Module: Process

Improve error messages on Process.register/2 errors

Tool: Elixir Module: Registry

Add a local, decentralized and scalable key-value process storage

Tool: Elixir Module: Stream

Add Stream.map_every/2 that invokes the given function with every nth item

Tool: Elixir Module: Stream

Introduce Stream.zip/1 to lazily zip multiple entries at once

Tool: Elixir Module: String

Update to Unicode 9.0.0

Tool: Elixir Module: Task

Add Task.async_stream/3 and Task.async_stream/5 as well as the supervised versions Task.Supervisor.async_stream/4 and Task.Supervisor.async_stream/6

Tool: Elixir Module: URI

Allow 0 as URI scheme default port

Tool: ExUnit Module: ExUnit.Diff

Use red or green background for whitespace-only diffs

Tool: ExUnit Module: ExUnit.Doctest

Allow inspected structures with multiples lines and unicode characters in the doctest result

Tool: ExUnit Module: ExUnit.Formatter

Replace lhs/rhs with left/right in the formatter for clarity

Tool: IEx Module: IEx.Autocomplete

Stop appending a trailing dot when autocompleting modules in IEx

Tool: IEx Module: IEx.Autocomplete

Support autocompletion for structs

Tool: IEx Module: IEx.Autocomplete

Improve IEx autocomplete to support navigating map atom keys

Tool: IEx Module: IEx.Helpers

c/1 now compiles in memory by default to avoid common issue where .beam files remain at projects root directory

Tool: IEx Module: IEx.Helpers

Add info about protocols in i/1

Tool: IEx Module: IEx.Server

Support interrupting IEx evaluation through the Ctrl+G prompt

Tool: Mix Module: mix archive

Compress archive files built by mix archive as they are now unzipped during installation

Tool: Mix Module: mix archive

Install from SCM

Tool: Mix Module: mix compile

Automatically infer the list of applications for Mix projects

Tool: Mix Module: mix cmd

Add the ability to specify one or more apps in mix cmd

Tool: Mix Module: mix deps

Warn if there are non-applications in the apps directory for umbrella projects

Tool: Mix Module: mix deps

Add warning for invalid paths on mix deps.clean

Tool: Mix Module: mix deps

Add Mix.Project.apps_paths that returns the paths to children applications in umbrella projects

Tool: Mix Module: mix deps

Add MIX_REBAR environment variable for overriding local rebar

Tool: Mix Module: mix escript

Install from SCM

Tool: Mix Module: mix new

Check directory existence in mix new and ask how to proceed if one exists

Tool: Mix Module: mix new

Applications built with the --sup flag now have an individual module to work as application callback

Tool: Mix Module: mix test

Add --formatter option to mix test

Tool: Mix Module: mix xref

Provide "did you mean?" suggestions for mix xref

Tool: Elixir Module: Enum

Enum.partition/2 has been deprecated in favor of Enum.split_with/2

Tool: Elixir Module: System

Deprecate plural time units in favor of singular ones to align with future Erlang releases

Tool: ExUnit Module: ExUnit

Using GenEvent to implement ExUnit formatters is deprecated. Please use the new GenServer based formatters instead

Tool: Elixir Module: Access

Access.key/1 is deprecated due to erratic behaviour for missing keys, please use Access.key/2 instead with proper default values

Tool: Elixir Module: Behaviour

The Behaviour module is deprecated. Callbacks may now be defined directly via the @callback attribute

Tool: Elixir Module: Enum

Deprecate Enum.uniq/2 in favor of Enum.uniq_by/2

Tool: Elixir Module: Float

Float.to_char_list/2 and Float.to_string/2 are deprecated (use the :erlang functions if such conversions are desired)

Tool: Elixir Module: Kernel

Deprecate support for making private functions overridable. Overridable functions must always be public as they must be contracts

Tool: Elixir Module: Kernel

Warn if variable is used as a function call

Tool: Elixir Module: OptionParser

Deprecate aliases with multiple letters, such as -abc

Tool: Elixir Module: Set

Deprecate the Set module

Tool: Elixir Module: Stream

Deprecate Stream.uniq/2 in favor of Stream.uniq_by/2

Tool: IEx Module: IEx.Helpers

import_file/2 is deprecated in favor of import_file_if_available/1

Tool: Mix Module: Mix.Utils

underscore/1 and camelize/1 are deprecated

Bugfix

19 changes

Tool: Elixir Module: Access

Do not accept nils in Access.key/1 and Access.key/2 in favor of explicit default values (or Access.key!/1 if you expect the key to always be available)

Tool: Elixir Module: Float

Avoid multiple roundings in Float.ceil/2, Float.floor/2 and Float.round/2

Tool: Elixir Module: Kernel

Don't crash in macro_exported?/3 when dealing with Erlang modules

Tool: Elixir Module: Kernel

Ensure locals calls are rewritten when calling a local function or macro from inside a module

Tool: Elixir Module: Kernel

Annotate the context for variables as zero-arity funs in quotes

Tool: Elixir Module: Kernel.SpecialForms

Ensure comprehensions with guards and filters keep proper ordering,

Tool: Elixir Module: Kernel.SpecialForms

Produce meaningful warning when with's else clauses have no effect

Tool: Elixir Module: Macro

Wrap fn calls in parens in Macro.to_string/2

Tool: Elixir Module: Macro

Do not print aliases as keys inside keyword lists in Macro.to_string/2

Tool: Elixir Module: OptionParser

Support options in OptionParser.to_argv/2 to ensure :count switches are correctly encoded

Tool: Elixir Module: Stream

Ensure Stream.take/2 does not consume next element on :suspend

Tool: Elixir Module: String

Fix infinite recursion in String.replace_leading/3 and String.replace_trailing/3 when given an empty string

Tool: Elixir Module: Task

Fix Task.shutdown/1,2 infinite block when task has no monitor

Tool: Elixir Module: Task

Ensure task cannot link after parents unlinks

Tool: ExUnit Module: ExUnit

Fix a race condition in assert_receive where we would assert a message was not received but show it in the list of messages when the message is delivered right after the timeout value

Tool: ExUnit Module: IEx.Helpers

Purge consolidated protocols before and after recompile/0

Tool: ExUnit Module: Mix.Dep

Use gmake on FreeBSD instead of make when compiling make dependencies

Tool: ExUnit Module: Mix.Project

Only copy files from source when they're newer than destination (for Windows machines)

Tool: ExUnit Module: Mix.Task

Ensure non-recursive tasks inside umbrella are reenabled