develop.jara: generalised stop condition for iteration with higher order function