Add support to map in ets:select_replace with match spec

ets:select_replace/2 can use match spec to do in place replacement with List, which is efficient. But it doesn’t support replacing map.
For example, the change to a list works:
ets:fun2ms(fun({K, L}) when is_list(L) → {K, [marker | L]} end).
Output: [{{‘$1’,‘$2’},[{is_list,‘$2’}],[{{‘$1’,[marker|‘$2’]}}]}]
But for something similar with map:
ets:fun2ms(fun({K, Map}) when is_map(Map) → {K, Map#{marker => true}} end).
Error: the language element map (in body) cannot be translated into match_spec
Is Erlang/OTP team considering adding support to map as well?

1 Like