Hello,


I try to set up a verification on the number of arguments given to my program, but keep on getting "Parse error in pattern"

Here is what my code looks like:

main :: IO()
main = do
    -- On commence par ouvrir le fichier SAC en mode binaire
    argsList <- getArgs
    if (length (argsList) == 0)
       then do
             putStrLn $ "No filename given to the program.\n $ ProgramName file.sac"
             return ()
      else
             sacFile1 <- openBinaryFile fileToOpen ReadMode

ghci complains, and tells "Parse error in pattern", indicating the 'if' line number.

Can you please help ?
Thank you very much,
Florian