List.flatten/2

defmodule List do
  def flatten(list, tail)
end

Flattens the given list of nested lists. The list tail will be added at the end of the flattened list.

Empty list elements from list are discarded, but not the ones from tail.