digits :: Int -> [Int]
digits n
  | n < 10 = [n]
  | otherwise = digits (fst res) ++ [snd res]
    where res = divMod n 10
digits :: Int -> [Int]
digits n
  | n < 10 = [n]
  | otherwise = digits (fst res) ++ [snd res]
    where res = divMod n 10
digits n
  | n < 10 = [n]
  | otherwise = digits (fst res) ++ [snd res]
    where res = divMod n 10