[Haskell-cafe] catching fails on read

Jacques Bergeron jbergeron at dogico.com
Tue Apr 29 15:42:02 EDT 2008

I'm new to Haskell and have a stupid question.

How can a catch a parsing error on a read? Something like 

let s = "e"
in read s :: Int

I've been searching for a trick and couldn't find one. I want to enter 
commands directly from the keyboard and don't want the program to abort if I 
do a typing error.



More information about the Haskell-Cafe mailing list