This is an abbreviated syntax for updating a map:
iex> map = %{foo: "bar"}
%{foo: "bar"}
iex> map = %{map | foo: "quux"}
%{foo: "quux"}
Please note that unlike Map.put/3you can only update existing keys, which gives you some security. It looks more like Erlang :maps.update/3.
iex> map = %{map | baz: "quux"}
** (ArgumentError) argument error
(stdlib) :maps.update(:baz, "quux", %{foo: "bar"})
(stdlib) erl_eval.erl:255: anonymous fn/2 in :erl_eval.expr/5
(stdlib) lists.erl:1261: :lists.foldl/3
, , %TodoList{}, , , structs.
, , , todo_list | . , , add , , . .