anchor.diff:        end).
   
   rewrite_value(Old, New, Struct) ->
  -    rewrite(
  -      fun (Term) ->
  -              case Term =:= Old of
  -                  true ->
  -                      {stop, New};
  -                  false ->
  -                      continue
  -              end
  -      end,
  -      Struct).
  +    generic:transformb(?transform(Old, New), Struct).
   
   rewrite_key_value_tuple(Key, NewValue, Struct) ->
  -    rewrite(
  -      fun (Term) ->
  -              case Term of
  -                  {Key, _} ->
  -                      {stop, {Key, NewValue}};
  -                  _ ->
  -                      continue
  -              end
  -      end,
  -      Struct).
  +    generic:transformb(?transform({Key, _}, {Key, NewValue}), Struct).
   
   rewrite_tuples(Fun, Struct) ->
       rewrite(
  
positive.code: 
  -include("triq.hrl").
  -include_lib("eunit/include/eunit.hrl").
  
  -compile(export_all).
  
  
negative.code:     [] = rotate([]).
  
  rewrite(Fun, Term) ->
      generic:maybe_transform(
        fun (T) ->
                case Fun(T) of
                    continue ->
                        {continue, T};
                    {stop, NewTerm} ->
                        {stop, NewTerm}
                end
        end, Term).
  
  rewrite_correctly_callbacks_on_tuples_test() ->
      executing_on_new_process(
  