implementing conversion of sequences to cascaded lambdas in cps conversion