Transducer-based implementation of a String -> N function.