# `ExUtils.Modules.Extend`
[🔗](https://github.com/sheharyarn/ex_utils/blob/main/lib/ex_utils/modules/extend.ex#L1)

Allows extending a module, keeping all functions from the referenced
module by delegating them.

# `__using__`
*macro* 

For a given module, defines and duplicates all of that module's
functions in the caller module. This is equivalent to calling
`Kernel.defdelegate/2` for every public function of that module.

## Example

Imagine you want to duplicate Elixir's built-in Map module
but with additional functions or to override behaviors.

```elixir
defmodule MyMap do
  use ExUtils.Modules.Extend, from: Map

  # Add a new function
  def empty, do: %{}

  # Override existing function
  defoverridable equal?: 2
  def equal?(left, right) do
    # add custom equality check here
  end
end
```

With this, you can call your new functions `MyMap.empty()` and
`MyMap.equal?(m1, m2)` but also all other `Map` functions, such
as `MyMap.get/2`, `MyMap.drop/2`, etc.
`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
