   end
 
   @doc """
-  This function returns `true` for a valid format type, `false` otherwise.
-  This function can be used in guards.
+  Returns `true` for a valid format type, `false` otherwise.  This macro can be
+  used in guards.
   """
   defguard supports(format) when format in @formats
 
   @doc """
-  Checks if the value matches the given type.
-  """
-  @spec is?(format, any) :: boolean
+  Checks if the value matches the given type. The function expected a available
+  `format` and a `string` to check. Returns `true` for a valid `string`, `false`
+  otherwise.
+
+  ## Examples
+
+      iex> Format.is?(:email, "foo@bar.net")
+      iex> true
+      iex> Format.is?(:email, "foo.bar.net")
+      iex> false
+
+  """
+  @spec is?(format, String.t()) :: boolean
   for fmt <- @formats do
-    def is?(unquote(fmt), string) do
+    def is?(unquote(fmt), string) when is_binary(string) do
       unquote(:"#{Atom.to_string(fmt)}?")(string)
     end
   end

      )
      ^(?:(?&rootless)|(?&noscheme)|(?&absolute)|(?&abempty))$
    /x

    Regex.match?(regex, string)
  end

  def uri_template_path?(_), do: false

  @doc """
  Checks if the value is a valid uri qurey.

  See also `Xema.Format.uri?/1`.
  """
  @spec uri_query?(any) :: boolean
  def uri_query?(string) when is_binary(string) do
    regex = ~r/
      (?(DEFINE)
        (?<pct_encoded> %[[:xdigit:]][[:xdigit:]] )
        (?<chars>  [-._~[:alnum:]!$&'()*+,;=:@] )

  #

  @doc """
  Checks if the `string` is a valid URI representation.

  This function returns `true` if the value is a string and is formatted as
  defined by [RFC 3986](https://tools.ietf.org/html/rfc3986), `false` otherwise.
