Higher-order function that uses only function application and earlier defined combinators.