 
   @doc """
   Percent-unescape a URI.
+  
+  ## Examples
+  
+      iex> URI.decode("http%3A%2F%2Felixir-lang.com")
+      "http://elixir-lang.com"
+  
   """
   def decode(<<?%, hex1, hex2, tail :: binary >>) do
     << bsl(hex2dec(hex1), 4) + hex2dec(hex2) >> <> decode(tail)

  @doc """
  Returns an iterator function over the query string that decodes
  the query string in steps.
  """
  def query_decoder(q) when is_binary(q) do
    fn(acc, fun) ->

  URL encoded as per `encode/1`. Keys and values can be any term
  that implements the `String.Chars` protocol (i.e. can be converted
  to a binary).
  
  ## Examples

      iex> hd = HashDict.new([{"foo", 1}, {"bar", "2"}])
      #HashDict<[{"bar", "2"}, {"foo", 1}]>
      iex> URI.encode_query(hd)
      "bar=2&foo=1"

  """
  def encode_query(l), do: Enum.map_join(l, "&", &pair/1)

