Fold generalized to StatefulWork