Restructure qsSeq to help the compiler infer totality.