anchor.diff:      {{finalise_aggregation, FnName, FinaliserLen + length(Fns2)}, Fns2}.
   
   %%
  +maybe_infer_op_type(_, error, _, Errors) ->
  +    {error, Errors};
  +maybe_infer_op_type(_, _, error, Errors) ->
  +    {error, Errors};
  +maybe_infer_op_type(Op, AType, BType, Errors) ->
  +    case infer_op_type(Op, AType, BType) of
  +        {error, Reason} ->
  +            {error, [Reason | Errors]};
  +        Type ->
  +            {Type, Errors}
  +    end.
  +
  +%%
   infer_op_type('/', sint64, sint64) -> sint64;
   infer_op_type('/', double, double) -> double;
   infer_op_type('/', sint64, double) -> double;
  
positive.code: compile_select_col(DDL, {{window_agg_fn, FnName}, [FnArg1]}) when is_atom(FnName) ->
      case riak_ql_window_agg_fns:start_state(FnName) of
          stateless ->
              % TODO this does not run the function! nothing is stateless so far though
              Fn = compile_select_col_stateless(DDL, FnArg1),
              #single_sel_column{ calc_type        = rows,
                                  initial_state    = undefined,
  
negative.code:     end,
      {Type, Errors};
  infer_col_type(DDL, {{window_agg_fn, FnName}, [FnArg1]}, Errors1) ->
      case infer_col_type(DDL, FnArg1, Errors1) of
          {error, _} = Error ->
              Error;
          {ArgType, Errors2} ->
              infer_col_function_type(FnName, [ArgType], Errors2)
      end;
  infer_col_type(DDL, {Op, A, B}, Errors1) when Op == '/'; Op == '+'; Op == '-'; Op == '*' ->
      {AType, Errors2} = infer_col_type(DDL, A, Errors1),
      {BType, Errors3} = infer_col_type(DDL, B, Errors2),
      maybe_infer_op_type(Op, AType, BType, Errors3);
  infer_col_type(DDL, {negate, AST}, Errors) ->
      infer_col_type(DDL, AST, Errors).
  
  %%
  infer_col_function_type(FnName, ArgTypes, Errors) ->
      case riak_ql_window_agg_fns:fn_type_signature(FnName, ArgTypes) of
          {error, Reason} ->
              {error, [Reason | Errors]};
          ReturnType ->
              {ReturnType, Errors}
      end.
  
  %%
  pull_from_row(N, Row) ->
  