From b84c9bbb7c9db688118ad756c1c43ef034fd98fb Mon Sep 17 00:00:00 2001 From: Mario Lang Date: Sun, 13 Sep 2015 00:46:49 +0200 Subject: Follow some hlint suggestions. --- src/Utility/Exception.hs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/Utility/Exception.hs') 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 -- cgit v1.2.3