anchor.diff:                      CtxAcc1 = Fun(C, CtxAcc),
                       CtxAcc2 = Fun(T, CtxAcc1),
                       CtxAcc3 = Fun(N, CtxAcc2),
  -                    {SubAcc, CtxAcc4} = foldi(O, Fun, CtxAcc3),
  +                    {SubAcc, CtxAcc4} = foldi(FType, O, Fun, CtxAcc3),
                       {Acc ++ [lists:flatten([binary_to_list(C), " ", atom_to_list(T), "(", N, ") ", SubAcc])]
                       , CtxAcc4};
                   {C, {T, N, N1}, O} when is_binary(C) ->
  
positive.code:         end,
          {[], NewCtx},
          OrderBy),
      {if Size > 0 ->
          " order by " ++ string:join(OrderByStr, ", ")
          ++ " ";
          true -> ""
       end
      , NewCtx1};
  
  % joins
  foldi({JoinType, Tab} = ST, Fun, Ctx)
   when (is_function(Fun,2) andalso (
          (JoinType =:= cross_join) orelse
          (JoinType =:= natural_join) orelse
          (JoinType =:= natural_inner_join)
       )) ->
      NewCtx = Fun(ST, Ctx),
      NewCtx1 = Fun(JoinType, NewCtx),
      {TabStr, NewCtx2} = foldi(Tab, Fun, NewCtx1),
      {case JoinType of
          cross_join          -> " cross join ";
          natural_join        -> " natural join ";
          natural_inner_join  -> " natural inner join "
       end ++ TabStr
      , NewCtx2};
  foldi({{JoinType,OptPartition,OptNatural},Tab,OptPartition1,OnOrUsing} = ST, Fun, Ctx)
   when (is_function(Fun,2) andalso (
          (JoinType =:= full) orelse
          (JoinType =:= left) orelse
  
negative.code:         {[], NewCtx1},
          Ts),
      NewCtx3 = Fun(R, NewCtx2),
      NewCtx4 = case FType of
          top_down -> NewCtx3;
          bottom_up -> Fun(ST, NewCtx3)
      end,
      {"drop table "
       ++ if E =:= true -> " if exists "; true -> "" end
       ++ string:join(Tables, ", ")
       ++ " " ++ atom_to_list(R)
      , NewCtx4};
  
  %
  % DELETE
  %
  foldi(FType, {'delete', Table, Where, Return} = ST, Fun, Ctx)
   when is_binary(Table), is_function(Fun, 2) ->
      NewCtx = case FType of
          top_down -> Fun(ST, Ctx);
          bottom_up -> Ctx
      end,
      NewCtx1 = Fun(Table, NewCtx),
      {WhereStr, NewCtx2} = foldi(FType, Where, Fun, NewCtx1),
      {ReturnStr, NewCtx3} = foldi(FType, Return, Fun, NewCtx2),
      NewCtx4 = case FType of
          top_down -> NewCtx3;
          bottom_up -> Fun(ST, NewCtx3)
      end,
      {"delete from " ++ binary_to_list(Table)
       ++ " " ++ WhereStr ++ ReturnStr
      , NewCtx4};
  
  %
  % GRANT
  %
  foldi(FType, {'grant', Objs, {OnTyp, On}, {'to', Tos}, Opts} = ST, Fun, Ctx)
   when is_atom(OnTyp), is_atom(Opts), is_function(Fun, 2) ->
      NewCtx = case FType of
          top_down -> Fun(ST, Ctx);
          bottom_up -> Ctx
      end,
      {ObjsStr, NewCtx1} = lists:foldl(fun(O, {Acc, CtxAcc}) ->
              {Acc++[atom_to_list(O)], Fun(O, CtxAcc)}
          end,
  