How to typespec function that adds a key to a map

As far as I am aware, there is not. You are able to do some trickery with quote/unquote in typespecs to reduce repetition, but the resulting code is far from pretty.

See Specifying map or struct extension using typespecs for a recent discussion about essentially the same situation.

1 Like