When writing Elixir apps you’ll typically find yourself building up state in a map. Typically these maps contain deep nesting. Updating anything deeply nested means you have to write something like: my_map = %{ foo: %{ bar: %{ baz: "my value" } } } new_bar_map = my_map |> Map.get(:foo) |> Map.get(:bar) |> Map.put(:baz, "new value") new_foo_map = my_map |> Map.get(:foo) |> Map.put(:bar, new_bar_map