anchor.diff:          conflicts = Conflicts,
           limit = Limit,
           feed = ResponseType,
  -        filter_fun = FilterFun
  +        filter_fun = Filter
       } = Args,
       #changes_acc{
           db = Db,
           seq = StartSeq,
           prepend = Prepend,
  -        filter = FilterFun,
  +        filter = Filter,
           callback = Callback,
           user_acc = UserAcc,
           resp_type = ResponseType,
  
positive.code: 
  send_changes(Args, Acc0, FirstRound) ->
      #changes_args{
          dir = Dir,
          filter = FilterName,
          filter_args = FilterArgs
      } = Args,
      #changes_acc{
          db = Db,
          seq = StartSeq
      } = Acc0,
      case FirstRound of
      true ->
          case FilterName of
          "_doc_ids" when length(FilterArgs) =< ?MAX_DOC_IDS ->
              send_changes_doc_ids(
                  FilterArgs, Db, StartSeq, Dir, fun changes_enumerator/2, Acc0);
          "_design" ->
              send_changes_design_docs(
                  Db, StartSeq, Dir, fun changes_enumerator/2, Acc0);
          _ ->
              couch_db:changes_since(
                  Db, StartSeq, fun changes_enumerator/2, [{dir, Dir}], Acc0)
          end;
      false ->
          couch_db:changes_since(
              Db, StartSeq, fun changes_enumerator/2, [{dir, Dir}], Acc0)
      end.
  
  
  send_changes_doc_ids(DocIds, Db, StartSeq, Dir, Fun, Acc0) ->
      Lookups = couch_btree:lookup(Db#db.id_tree, DocIds),
      FullDocInfos = lists:foldl(
          fun({ok, FDI}, Acc) ->
              [FDI | Acc];
          (not_found, Acc) ->
              Acc
          end,
          [], Lookups),
      send_lookup_changes(FullDocInfos, StartSeq, Dir, Db, Fun, Acc0).
  
  
  send_changes_design_docs(Db, StartSeq, Dir, Fun, Acc0) ->
      FoldFun = fun(FullDocInfo, _, Acc) ->
          {ok, [FullDocInfo | Acc]}
      end,
      KeyOpts = [{start_key, <<"_design/">>}, {end_key_gt, <<"_design0">>}],
      {ok, _, FullDocInfos} = couch_btree:fold(
          Db#db.id_tree, FoldFun, [], KeyOpts),
      send_lookup_changes(FullDocInfos, StartSeq, Dir, Db, Fun, Acc0).
  
  
  send_lookup_changes(FullDocInfos, StartSeq, Dir, Db, Fun, Acc0) ->
      FoldFun = case Dir of
      fwd ->
          fun lists:foldl/3;
      rev ->
          fun lists:foldr/3
      end,
      GreaterFun = case Dir of
      fwd ->
          fun(A, B) -> A > B end;
      rev ->
          fun(A, B) -> A =< B end
      end,
      DocInfos = lists:foldl(
          fun(FDI, Acc) ->
              DI = couch_doc:to_doc_info(FDI),
              case GreaterFun(DI#doc_info.high_seq, StartSeq) of
              true ->
                  [DI | Acc];
              false ->
                  Acc
              end
          end,
          [], FullDocInfos),
      SortedDocInfos = lists:keysort(#doc_info.high_seq, DocInfos),
      FinalAcc = try
          FoldFun(
              fun(DocInfo, Acc) ->
                  case Fun(DocInfo, Acc) of
                  {ok, NewAcc} ->
                      NewAcc;
                  {stop, NewAcc} ->
                      throw({stop, NewAcc})
                  end
              end,
              Acc0, SortedDocInfos)
      catch
      throw:{stop, Acc} ->
          Acc
      end,
      case Dir of
      fwd ->
          {ok, FinalAcc#changes_acc{seq = couch_db:get_update_seq(Db)}};
      rev ->
          {ok, FinalAcc}
      end.
  
  
  
negative.code:         dir = Dir,
          since = Since
      } = Args1,
      Filter = configure_filter(FilterName, Style, Req, Db0),
      Args = Args1#changes_args{filter_fun = Filter},
      Start = fun() ->
          {ok, Db} = couch_db:reopen(Db0),
          StartSeq = case Dir of
  