hugs98 Februar 2001 release and graphics

Friedrich Dominicus frido@q-software-solutions.com
Thu, 15 Feb 2001 10:44:51 +0100


Sorry, I do not know whom to ask. But the new version Hugs as of
Feb 2001 does not work with graphics any longer. 

It seems that IOResult has changed significantly and so this code here
does not work any longer
safeTry :: IO a -> IO (Either IOError a)
-- safeTry m = m >>= return . Right
safeTry (IO m) = IO $ \ f s -> 
  case catchError (m Hugs_Error Hugs_Return) of
  Just (Hugs_Return a) -> s (Right a)
  r                    -> s (Left (mkErr r))
 where
  mkErr :: Maybe IOResult -> IOError
  -- mkErr (Just Hugs_SuspendThread) = userError "suspended inside
protected code"
  mkErr (Just (Hugs_ExitWith e))  = userError "exited inside protected
code"
  mkErr (Just (Hugs_Error e))     = e
  mkErr Nothing                   = userError "pattern match failure
inside protected code"


It would be nice if someone could point out what to do, to make those
examples run again. I tried to learn Haskell with the SOE book and I'm
quite helpless if that does not work any longer.

Regards
Friedrich