transactional

Run this program as a transaction: its State effects hit a local copy of the state, seeded by reading the downstream handler, and the final local state is committed downstream only if the program completes. If it fails part-way (e.g. a Failure.Raise handled outside), the commit is part of the abandoned continuation and never runs — the downstream state stays untouched. Built from flatMap alone, so it is safe under a multi-shot handler such as collectAll: each branch reads, runs and commits independently.

The state passes through untouched, so no state type is needed here.