   @type value :: any
 
   @type get_fun(data, get_value) ::
-        (:get, data, (term -> term) ->
-        {get_value, new_data :: container})
+          (:get, data, (term -> term) ->
+             {get_value, new_data :: container})
 
   @type get_and_update_fun(data, get_value) ::
-        (:get_and_update, data, (term -> term) ->
-        {get_value, new_data :: container} | :pop)
+          (:get_and_update, data, (term -> term) ->
+             {get_value, new_data :: container} | :pop)
 
   @type access_fun(data, get_value) ::
-        get_fun(data, get_value) | get_and_update_fun(data, get_value)
+          get_fun(data, get_value) | get_and_update_fun(data, get_value)
 
   @doc """
   Invoked in order to access the value stored under `key` in the given term `term`.


  defmacrop raise_undefined_behaviour(exception, module, top) do
    quote do
      stacktrace = System.stacktrace
      exception =
        case stacktrace do
          [unquote(top) | _] ->
            %{unquote(exception) | reason: "#{inspect unquote(module)} does not implement the Access behaviour"}
          _ ->
            unquote(exception)
        end
      reraise exception, stacktrace
    end
  end

      iex> get_in(%{}, [Access.filter(fn a -> a == 10 end)])
      ** (RuntimeError) Access.filter/1 expected a list, got: %{}
  """
  @spec filter((term -> boolean)) :: access_fun(data :: list, get_value :: list)
  def filter(func) when is_function(func) do
    fn op, data, next -> filter(op, data, func, next) end
  end

  defp filter(:get, data, func, next) when is_list(data) do
