restrict function arity via higher-order functions