The past week we have released Elixir v0.8.2. It contains many bug fixes and better support for Erlang R16, including the new built-in functions insert_elem/3 and delete_elem/2.

We have also added extensive support to ANSI escape codes. For example, by simply upgrading to the latest Elixir you will get colored output from your test suites:

ANSI escape with ExUnit

We have also added colored output to Interactive Elixir (IEx) but it requires Erlang R16.

Finally, Elixir has always given special attention to documentation. You can easily document functions with the @doc attribute:

defmodule Math do
  @doc """
  Add two numbers together.

  ## Examples

      iex> Math.add(1, 2)

  def add(a, b) do
    a + b

The documentation above is embedded into the module and can be easily retrieved at runtime. For example, by typing h Math.add/2 into Interactive Elixir, we can access the documentation for that module.

Elixir v0.8.2 takes this to the next level by adding support to doctests. Given the example above, you can configure Elixir to automatically run the code samples in your documentation by including a call to the doctest macro in your test suite:

defmodule MathTest do
  use ExUnit.Case, async: true
  doctest Math

You can learn more about doctests on our documentation page and get more information about our latest release on the CHANGELOG.

If you are new to Elixir, it’s easy to get started with!