Url.Interpolate provides a single function, interpolate, which takes
a [URI Template][rfc6570] string and a Dict of variables, and expands
the input string according to the rules in [IETF RFC 6570][rfc6570],
up to Level 3 (Level 4 compliance is not provided or planned).
Example URI template interpolation:
interpolate "http://example.com/{path}{?x,y,empty}" <| Dict.fromList [("path", "hello"), ("x", "1024"), ("y", "768")]
Internal note: I was surprised to find that the baseline %-encode rules for URI templates are slightly different than the built-in
encodeURIComponent. For instance, '!' is escaped for the template operations that use the "unrestricted set" of unescaped characters, while the built-in does not escape it. Thus, we rely on theHexlibrary rather thanUrl.percentEncode.