map.to.singleton function

Converts a tree without singletons to a tree with singleton nodes