anchor.diff:  %% leave the queue unmodified. This function has a constant-time complexity. It returns
   %% the result of evaluating `Fun'.
   try_pop_and_purge(Mem, Fun) when is_function(Fun, 1) ->
  -  case pop_internal(Mem, Fun) of
  +  case read_head(Mem, Fun) of
       {Res, true} ->
         init_header(Mem),
         Res;
  
positive.code: peek(Mem, Init, Fun) when is_function(Fun, 2) ->
    F = fun
      G(H, T, State) when H < T ->
        {Msg, NextH} = read_internal(Mem, H),
        case Fun(Msg, State) of
          {cont, State1} ->
            G(NextH, T, State1);
  
negative.code: pop(Mem, Init, Fun) when is_function(Fun, 2) ->
    F = fun
      G(H, T, State) when H < T ->
        {Msg, NextH} = read_first(Mem, H),
        case Fun(Msg, State) of
          {cont, State1} ->
            update_head(Mem, NextH),
  