summaryrefslogtreecommitdiff
path: root/src/Utility/Exception.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Utility/Exception.hs')
-rw-r--r--src/Utility/Exception.hs5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/Utility/Exception.hs b/src/Utility/Exception.hs
index 9d4236c4..a1f96615 100644
--- a/src/Utility/Exception.hs
+++ b/src/Utility/Exception.hs
@@ -36,10 +36,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