Haskell: add error handling and try*/catch*.