mirror of
https://github.com/xmonad/xmonad.git
synced 2025-05-19 00:20:22 -07:00
Generalize the type of catchIO, use it in Main.hs
This commit is contained in:
parent
10be8aaae0
commit
f80d593d57
3
Main.hs
3
Main.hs
@ -16,7 +16,6 @@ module Main (main) where
|
|||||||
|
|
||||||
import XMonad
|
import XMonad
|
||||||
|
|
||||||
import Control.Exception (handle)
|
|
||||||
import System.IO
|
import System.IO
|
||||||
import System.Info
|
import System.Info
|
||||||
import System.Environment
|
import System.Environment
|
||||||
@ -31,7 +30,7 @@ import qualified Properties
|
|||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = do
|
main = do
|
||||||
args <- getArgs
|
args <- getArgs
|
||||||
let launch = handle (hPrint stderr) buildLaunch >> xmonad defaultConfig
|
let launch = catchIO buildLaunch >> xmonad defaultConfig
|
||||||
case args of
|
case args of
|
||||||
[] -> launch
|
[] -> launch
|
||||||
["--resume", _] -> launch
|
["--resume", _] -> launch
|
||||||
|
@ -291,7 +291,7 @@ io = liftIO
|
|||||||
|
|
||||||
-- | Lift an IO action into the X monad. If the action results in an IO
|
-- | 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.
|
-- exception, log the exception to stderr and continue normal execution.
|
||||||
catchIO :: IO () -> X ()
|
catchIO :: MonadIO m => IO () -> m ()
|
||||||
catchIO f = io (f `catch` \e -> hPrint stderr e >> hFlush stderr)
|
catchIO f = io (f `catch` \e -> hPrint stderr e >> hFlush stderr)
|
||||||
|
|
||||||
-- | spawn. Launch an external application
|
-- | spawn. Launch an external application
|
||||||
|
Loading…
x
Reference in New Issue
Block a user