Hello,

I have this :

-- | Main entry point to the application.
module Main where


-- | convert a number to a array in pieces where a negative number will be a empty array.
toDigits :: Integer -> [Integer]
toDigits n
  | n < 0 = []
  | otherwise = n/10 : []

-- | The main entry point.
main :: IO ()
main = do
    toDigits 123
   

but as soon as I try to compile it , I see this error :


src/Main.hs@14:5-14:17
Couldn't match expected type ‘IO ()’ with actual type
[Integer]
… In a stmt of a 'do' block: toDigits 123 In the expression: do { toDigits 123 }

Roelof