higher-order function.