List.keyreplace/4

defmodule List do
  def keyreplace(list, key, position, new_tuple)
end

Receives a list of tuples and if the identified element by key at position exists, it is replaced with new_tuple.

If no tuple is found the list is returned untouched.