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
Friedrich Dominicus wrote:
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 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.
Unfortunately the Hugs Graphics Library (http://haskell.org/graphics/) is incompatible with a change that was made to the Hugs representation of the IO monad in order to correct another bug. However, the graphics library web page also mentions that a fix to the library is under way. So there' hope... -- Johan
participants (2)
-
Friedrich Dominicus -
Johan Nordlander