Proper implementation of loop chains, which allow for serial iteration with a generic condition function.