diff options
| author | Mario Lang <mlang@delysid.org> | 2015-09-13 00:46:49 +0200 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2015-09-13 13:21:41 -0400 |
| commit | b84c9bbb7c9db688118ad756c1c43ef034fd98fb (patch) | |
| tree | 61d50f50f58714e9df2390c337fa7bb2ff34d3ea /src/Utility/Exception.hs | |
| parent | 2af70d4ac7ff25a3e596de195abe40db46c74074 (diff) | |
Follow some hlint suggestions.
Diffstat (limited to 'src/Utility/Exception.hs')
| -rw-r--r-- | src/Utility/Exception.hs | 5 |
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 |
