From 89e27deb6dc0498a2af339ce9bed1af3c0c86947 Mon Sep 17 00:00:00 2001 From: Spencer Janssen Date: Mon, 11 Jun 2007 18:06:08 +0200 Subject: Rename safeIO to catchIO darcs-hash:20070611160608-a5988-a042d190c15b993b15da274db915ca73d9c8e089.gz --- XMonad.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'XMonad.hs') diff --git a/XMonad.hs b/XMonad.hs index 4309fe1..7258fbb 100644 --- a/XMonad.hs +++ b/XMonad.hs @@ -17,7 +17,7 @@ module XMonad ( X, WindowSet, WorkspaceId(..), ScreenId(..), XState(..), XConf(..), Layout(..), Typeable, Message, SomeMessage(..), fromMessage, - runX, io, safeIO, withDisplay, withWindowSet, isRoot, spawn, restart, trace, whenJust, whenX, + runX, io, catchIO, withDisplay, withWindowSet, isRoot, spawn, restart, trace, whenJust, whenX, atom_WM_STATE, atom_WM_PROTOCOLS, atom_WM_DELETE_WINDOW ) where @@ -137,8 +137,10 @@ fromMessage (SomeMessage m) = cast m io :: IO a -> X a io = liftIO -safeIO :: IO () -> X () -safeIO f = liftIO (f `catch` \e -> do hPutStrLn stderr (show e); hFlush stderr) +-- | Lift an IO action into the X monad. If the action results in an IO +-- exception, log the exception to stderr and continue normal execution. +catchIO :: IO () -> X () +catchIO f = liftIO (f `catch` \e -> do hPutStrLn stderr (show e); hFlush stderr) -- | spawn. Launch an external application spawn :: String -> X () -- cgit v1.2.3