   @doc """
   Merges two dictionaries.
   """
+  @spec merge(t, t | Dict.t) :: t
+  @spec merge(t, t | Dict.t, ((key :: term, value1 :: term, value2 :: term) -> value :: term)) :: t
   def merge(dict, enum, callback // fn(_k, _v1, v2) -> v2 end)
 
   def merge(dict1, dict2, callback) when is_record(dict1, HashDict) and is_record(dict2, HashDict) and elem(dict1, 1) < elem(dict2, 1) do

  @doc """
  Checks if the dict has the given key.
  """
  def has_key?(dict, key) do
    match? { ^key, _ }, dict_get(dict, key)
  end

  @doc """
  Returns an empty dict.
  """
  @spec empty(t) :: t
  def empty(_) do
    ordered()
  end
