diff options
Diffstat (limited to 'Utility/Exception.hs')
-rw-r--r-- | Utility/Exception.hs | 5 |
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 |