Compile-time transformation which eliminates higher-order functions, replacing them by a single first-order apply function