       [1, 2, 3]
 
   """
+  @spec replace_at(list, integer, any) :: list
   def replace_at(list, index, value) do
     if index < 0 do
       do_replace_at(list, length(list) + index, value)

      [a: 5, b: 3, c: 1]

  """
  def keysort(list, position) do
    :lists.keysort(position + 1, list)
  end

      [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
