List.update_at/3

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

Returns a list where its index-th element is updated according ta function fun.

If index is out of bounds, the original list is returned.

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