       [1,2,3,4,5]
 
   """
+  @spec flatten(deep_list, [elem]) :: [elem] when is_subtype(deep_list, [elem | deep_list]) and is_var(elem)
   def flatten(list, tail) do
     :lists.flatten(list, tail)
   end

      3

  """
  def last([]), do: nil

  def last(list) do

      [a: 3, b: 2]

  """
  @spec keyreplace([tuple], any, non_neg_integer, tuple) :: [tuple]
  def keyreplace(list, key, position, new_tuple) do
    :lists.keyreplace(key, position + 1, list, new_tuple)
  end
