[Haskell-beginners] Better error messages

Peter Hall peter.hall at memorphic.com
Thu Dec 29 21:25:31 CET 2011


If I have something like this

main = do
    args <- getArgs
    let file = args !! 0
    -- etc...


And I run it without any arguments, I get an error message like this:
"Prelude.(!!): index too large".

What's the best way to handle an error like this to give a better
message back to the user?


Peter



More information about the Beginners mailing list