     struct(struct, kv, fn
       {:__struct__, _}, acc -> acc
       {key, val}, acc ->
-        :maps.update(key, val, acc)
+        Map.replace!(acc, key, val)
     end)
   end
 

            _ = @enforce_keys
            def __struct__(kv) do
              :lists.foldl(fn {key, val}, acc ->
                :maps.update(key, val, acc)
              end, __struct__(), kv)
            end
          end

            def __struct__(kv) do
              {map, keys} =
                Enum.reduce(kv, {__struct__(), @enforce_keys}, fn {key, val}, {map, keys} ->
                  {Map.replace!(map, key, val), List.delete(keys, key)}
                end)
              case keys do
                [] -> map
