toBase b n
  | n < 0 = '-' : toBase b (- n)
  | n < bi = [int2Char n]
  | otherwise = (toBase b rest) ++ [int2Char currDigit]
   where bi = base2Int b 
         (rest, currDigit) = n `quotRem` bi

-- | print the corresponding character of a digit
toBase b n
  | n < 0 = '-' : toBase b (- n)
  | n < bi = [int2Char n]
  | otherwise = (toBase b rest) ++ [int2Char currDigit]
   where bi = base2Int b 
         (rest, currDigit) = n `quotRem` bi

-- | print the corresponding character of a digit
toBase b n
  | n < 0 = '-' : toBase b (- n)
  | n < bi = [int2Char n]
  | otherwise = (toBase b rest) ++ [int2Char currDigit]
   where bi = base2Int b 
         (rest, currDigit) = n `quotRem` bi

-- | print the corresponding character of a digit