List.update_at/3

defmodule List do
  def update_at(list, index, fun)
end

Returns a list with an updated value at the specified index. If index is out of bounds, the original list is returned.

Negative indices indicate an offset from the end of the list.