I was going through elixir project code base and i encounter the following please help me out what is here the matching operation is doing in function argument??
{ result, errors } = validate(schema, data, "", data) def validate(root = %{ custom: validator }, data, path, full_data) when is_function(validator) do { result, errors } = if Map.has_key?(root, :type), do: validate( Map.drop(root, [:custom]) , data, path ), else: { data, [] } case validator.(full_data, result, path) do { :ok, value } -> { value, errors } { :error, error } -> { result, errors ++ [ %{ param: path, code: :validation_error, message: error } ] } end end