   Merges the dict `dict2` into dict `dict1`.
 
   If one of the `dict2` entries is found in `dict1`, the
-  conflicting entries in `dict2` have higher precedence unless a
-  function is given to resolve conflicts.
+  conflicting entries in `dict2` have higher precedence.
 
   Notice this function is polymorphic as it merges dicts of any
   type. Each dict implementation also provides a `merge` function,

    end
  end


  defmacrop target(dict) do
    quote do
      case unquote(dict) do

      iex> dict = Dict.merge(dict1, dict2)
      iex> [a: Dict.get(dict, :a), b: Dict.get(dict, :b), d: Dict.get(dict, :d)]
      [a: 3, b: 2, d: 4]

  """
  @spec merge(t, t) :: t
  def merge(dict1, dict2) do
    target1 = target(dict1)
    target2 = target(dict2)

    if target1 == target2 do
      target1.merge(dict1, dict2)
    else
      do_merge(target1, dict1, dict2, fn(_k, _v1, v2) -> v2 end)
    end
  end

  @doc """
  Merges the dict `dict2` into dict `dict1`.

  If one of the `dict2` entries is found in `dict1`, the function
  will be invoked to resolve the conflict.

  Notice this function is polymorphic as it merges dicts of any
  type. Each dict implementation also provides a `merge` function,
  but they can only merge dicts of the same type.

  ## Examples

      iex> dict1 = Enum.into([a: 1, b: 2], dict_impl.new)
      iex> dict2 = Enum.into([a: 3, d: 4], dict_impl.new)
