anchor.diff:      %% this code works fine despite the backwards binding names
       Res = [{V, K} ||  #rpbpair{key=V, value=K} <- Results],
       ?INDEX_STREAM_RESULT{terms=Res};
  -process_index_response(true, Keys, []) ->
  +process_index_response(_, Keys, []) ->
       ?INDEX_STREAM_RESULT{keys=Keys}.
   
   -spec index_stream_result_to_index_result(index_stream_result()) ->
  
positive.code:     %% Unknown request/response combo
      {reply, {error, {unknown_response, Request, Reply}}, State}.
  
  %% Equate undefined as false when figuring out whether
  %% `process_index_response' should be handling simple keys or complex
  %% objects via return_terms and return_body
  just_keys(true, _) ->
      false;
  just_keys(_, true) ->
      false;
  just_keys(_, _) ->
      true.
  
  
  %% Helper for index responses
  -spec process_index_response(boolean(), list(), list()) ->
      index_stream_result().
  process_index_response(false, Keys, _) ->
      ?INDEX_STREAM_RESULT{keys=Keys};
  process_index_response(true, [], Results) ->
      %% If return_terms is true and return_body is false, rpbpair is
      %% abused to send Value,Key pairs as Key, Value pairs in a 2i
      %% query the 'key' is the index value and the 'value' the indexed
  
negative.code:     {reply, {ok, Results}, State};
  process_response(#request{msg = #rpbindexreq{stream=true, return_terms=Terms, return_body=Body}}=Request,
                   #rpbindexresp{results=Results, keys=Keys, done=Done, continuation=Cont}, State) ->
      ToSend = process_index_response(response_type(Terms, Body), Keys, Results),
      _ = send_caller(ToSend, Request),
      DoneResponse = {reply, {done, Cont}, State},
      case Done of
  