diff options
author | Adam Vogt <vogt.adam@gmail.com> | 2012-11-09 02:35:06 +0100 |
---|---|---|
committer | Adam Vogt <vogt.adam@gmail.com> | 2012-11-09 02:35:06 +0100 |
commit | 7f324e08476792e522987867c0f8098eeb0e50e0 (patch) | |
tree | b4deece8dd5395cc8ab39f73f6f36be50c07842f /XMonad/Prompt/Shell.hs | |
parent | 8210d1d6f72daa3a95dac7be71f3d3358dfe1191 (diff) | |
download | XMonadContrib-7f324e08476792e522987867c0f8098eeb0e50e0.tar.gz XMonadContrib-7f324e08476792e522987867c0f8098eeb0e50e0.tar.xz XMonadContrib-7f324e08476792e522987867c0f8098eeb0e50e0.zip |
Use Control.Exception.catch explitly to avoid warnings
Ignore-this: 2cebdfe604c581f2b4a644e9aed726c7
The base that comes with ghc-7.6.1 no longer includes Prelude.catch;
so these modules were changed so that there is no warning for
import Prelude hiding (catch)
At the same time these changes should be compatible with older GHCs,
since the catch being has never been the one in the Prelude.
darcs-hash:20121109013506-1499c-c593662b0780eb49287efcbfe0e9796f7dd57c73.gz
Diffstat (limited to 'XMonad/Prompt/Shell.hs')
-rw-r--r-- | XMonad/Prompt/Shell.hs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/XMonad/Prompt/Shell.hs b/XMonad/Prompt/Shell.hs index c391ca3..05ee5f4 100644 --- a/XMonad/Prompt/Shell.hs +++ b/XMonad/Prompt/Shell.hs @@ -30,10 +30,9 @@ module XMonad.Prompt.Shell ) where import Codec.Binary.UTF8.String (encodeString) -import Control.Exception +import Control.Exception as E import Control.Monad (forM) import Data.List (isPrefixOf) -import Prelude hiding (catch) import System.Directory (doesDirectoryExist, getDirectoryContents) import System.Environment (getEnv) import System.Posix.Files (getFileStatus, isDirectory) @@ -111,7 +110,7 @@ commandCompletionFunction cmds str | '/' `elem` str = [] getCommands :: IO [String] getCommands = do - p <- getEnv "PATH" `catch` econst [] + p <- getEnv "PATH" `E.catch` econst [] let ds = filter (/= "") $ split ':' p es <- forM ds $ \d -> do exists <- doesDirectoryExist d @@ -142,7 +141,7 @@ isSpecialChar = flip elem " &\\@\"'#?$*()[]{};" -- In order to /set/ an environment variable (eg. combine with a prompt so you can modify @$HTTP_PROXY@ dynamically), -- you need to use 'System.Posix.putEnv'. env :: String -> String -> IO String -env variable fallthrough = getEnv variable `catch` econst fallthrough +env variable fallthrough = getEnv variable `E.catch` econst fallthrough {- | Ask the shell what browser the user likes. If the user hasn't defined any $BROWSER, defaults to returning \"firefox\", since that seems to be the most |