packSnafu digits
| carry == 0 = shown
| otherwise = (snafuRep carry) : shown
- where (carry, shown) = foldl' packSnafuDigit (0, "")
+ where (carry, shown) = foldl' packSnafuDigit (0, "") digits
packSnafuDigit :: (Int, String) -> Int -> (Int, String)
packSnafuDigit (carry, acc) d