Is there a way to make a spec for the foo function that doesn’t require repeating the entire typespec for output map? Something like t() but with key18 => String.t()
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.
Thank you! I missed that topic while searching Hmm, I am not sure how to make this answer work with optional. It works with key: type where key is required. But how do I make it work with optional?