summaryrefslogtreecommitdiff
path: root/Utility.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-04-17 00:57:29 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-04-17 00:57:29 -0400
commit89fab6c7b8955ef26e653d539f7be3b70129c15e (patch)
tree440bbcf11ba845d9373b966bda4be018482f2668 /Utility.hs
parent9606409b9dd5218b0540418170ec86e9e1cec038 (diff)
refactor
Diffstat (limited to 'Utility.hs')
-rw-r--r--Utility.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Utility.hs b/Utility.hs
index 1c6b4d21e..5639a8799 100644
--- a/Utility.hs
+++ b/Utility.hs
@@ -24,6 +24,7 @@ module Utility (
dirContains,
dirContents,
myHomeDir,
+ catchBool,
prop_idempotent_shellEscape,
prop_idempotent_shellEscape_multiword,
@@ -256,3 +257,7 @@ myHomeDir = do
uid <- getEffectiveUserID
u <- getUserEntryForID uid
return $ homeDirectory u
+
+{- Catches IO errors and returns a Bool -}
+catchBool :: IO Bool -> IO Bool
+catchBool = flip catch (const $ return False)