Brendan Hay schreef op 5-2-2015 om 9:39:
toDigits :: Integer -> [Integer]
toDigits n 
  | n < 0 = []
  | otherwise = n/10 : []

Thanks,

it's now looking like this :

-- | 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 : []

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

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

but now I see this error message :

src/Main.hs@8:1-8:7
parse error on input module