anchor.diff:      end.
   
   % this will only match if you try to replace the whole document with an empty path
  -replace(_Obj, [], Val) ->
  +% However, this is only allowed if the resulting document is a valid JSON as well
  +replace(_Obj, [], Val) when ?IS_DICT(Val)->
       {ok, Val};
  +replace(Obj, [], Val) ->
  +    {error, {cantset, Obj, [], Val}};
   replace(Obj, [Field], Val) ->
       case get_(Obj, Field) of
           {ok, _FieldObj} ->
  
positive.code:         {error, Error} -> do_apply(Ops, Obj, [Error|Errors])
      end.
  
  % this will only match if you try to replace the whole document with an empty path
  add(_Obj, [], Val) ->
      {ok, Val};
  add(Obj, [Field], Val) ->
      add_(Obj, Field, Val);
  
  
negative.code: del_(Obj, <<"-">>) when is_list(Obj) ->
      {ok, lists:droplast(Obj)};
  
  del_(Obj, Field) when is_list(Obj) andalso is_integer(Field)
                        andalso length(Obj) >= Field andalso Field >= 0->
      Result = case lists:split(Field, Obj) of
                   {[], [_|T]} -> T;
                   {H1, [_|T]} -> H1 ++ T;
  