Folds over positions within a single path, for example all given children.
Folds over positions within a single path, for example all given children. As such positions must be calculated.
Takes the first root, returning Right(NoSingleRoot) if any of the subsequent roots don't match.
folder retrieves the current path
Each iteration folds the resulting tree back into the path. As this function must maintain the Path it does not expose the new path root until the result.
The progress through the document is in reverse document order. This ensures that transformations can always be safely composed, e.g. a delete of a path won't stop changes below it. This, however, implies the developer must also handle any accumalation in "reverse".