I don't know what is wrong with the code. I have just started coding in Haskell so sorry for the trouble.
tobase :: Int -> Int -> [Int]
tobase b x = tobase b (x `quot` b) : [x `mod` b]
tobase b x | x `mod` b == x = [x]
Couldn't match expected type ‘[Int]’ with actual type ‘Int’
In the expression: x `mod` b
In the second argument of ‘(:)’, namely ‘[x `mod` b]’
In the expression: tobase b (x `quot` b) : [x `mod` b]
tobase b (x `quot` b)will generate a list, not anIntitself, hence the type error.