summaryrefslogtreecommitdiff
path: root/Utility/Exception.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-09-13 13:39:48 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-09-13 13:39:48 -0400
commit6b209cd8578a4509e67dc187271f5f3a193acd97 (patch)
tree353b62e3fbe1e212e0af377722c3c3980a188826 /Utility/Exception.hs
parent1e9b95d13b4bd3461add92096fc142ef5126eab9 (diff)
merge hlint changes from propellor
Diffstat (limited to 'Utility/Exception.hs')
-rw-r--r--Utility/Exception.hs5
1 files changed, 1 insertions, 4 deletions
diff --git a/Utility/Exception.hs b/Utility/Exception.hs
index 30bcc9245..13000e033 100644
--- a/Utility/Exception.hs
+++ b/Utility/Exception.hs
@@ -39,10 +39,7 @@ catchBoolIO = catchDefaultIO False
{- Catches IO errors and returns a Maybe -}
catchMaybeIO :: MonadCatch m => m a -> m (Maybe a)
-catchMaybeIO a = do
- catchDefaultIO Nothing $ do
- v <- a
- return (Just v)
+catchMaybeIO a = catchDefaultIO Nothing $ a >>= (return . Just)
{- Catches IO errors and returns a default value. -}
catchDefaultIO :: MonadCatch m => a -> m a -> m a