Newbie question: Meta-functions?

Consider a function F that takes a function and produces a function based on structure of the input function. As an example consider F that takes all functions having at least two conditionals and swaps their conditional expressions. so

if condition(a, b, c) then calc1(z) else (calc(y) + (if condition1(a, m, k) then u else p ))


becomes

if condition1(a, b, c) then calc1(z) else (calc(y) + (if condition(a, m, k) then u else p ))


Do functions like these fit into category theory/computational science? How are they called? Would love any pointers on books/wikipedia articles about them.

-
What do you mean by "takes a function"? What's your input representation? Abstract functions don't have conditionals; only their implementations. –  JɛﬀE Feb 19 '13 at 18:30
lets say functions are represented as a composition of primitive functions. All functional programming languages rely on this way of creating complexity. It strikes me that most functional languages lack reflective capabilities so that the representation of the function itself can be inspected. This is why i ended up asking this question. –  Andrew Butenko Feb 21 '13 at 6:53