priority-fn is applied to list of args