 # Implements functions that only makes sense to lists
 # and cannot be part of the Enum protocol. In general,
 # favor using the Enum API instead of List.
+#
+# A decision was taken to delegate most functions to
+# Erlang's standard lib. Small performance gains
+# might be acquired by re-implementing them in Elixir.
 defmodule List do
   # Bifs: member/2, reverse/2
   # Bifs: keymember/3, keysearch/3, keyfind/3

      #=> [[1,2],[1,2]]

  """
  def duplicate(elem, n) do
    Erlang.lists.duplicate(n, elem)
  end

  ## Private

  # flatten

  defp do_flatten([h|t], tail) when is_list(h) do
    do_flatten(h, do_flatten(t, tail))
  end

  defp do_flatten([h|t], tail) do
    [h|do_flatten(t, tail)]
  end

  defp do_flatten([], tail) do
    tail
  end

  # seq

  defp do_seq(n, x, l) when n >= 4 do
    do_seq(n-4, x-4, [x-3,x-2,x-1,x|l])
  end

  defp do_seq(n, x, l) when n >= 2 do
    do_seq(n-2, x-2, [x-1,x|l])
  end

  defp do_seq(1, x, l) do
    [x|l]
  end

  defp do_seq(0, _, l) do
    l
  end

  # uniq



  """
  def seq(first, last) when is_integer(first) and is_integer(last) and first <= last + 1 do
    Erlang.lists.seq(first, last)
  end

  @doc """
