import Data.Char (intToDigit) import DList showInt :: Int -> DList Char showInt n | n < 10 = singleton (intToDigit n) showInt n | otherwise = showInt (n `div` 10) +++ showInt (n `mod` 10) go :: [Int] -> DList Char go [] = empty go (x:xs) = showInt x +++ singleton ' ' +++ go xs doIt :: [Int] -> String doIt xs = fromDList (go xs)