summaryrefslogtreecommitdiff
path: root/src/Propellor/Exception.hs
diff options
context:
space:
mode:
authorJoey Hess2016-06-20 13:48:54 -0400
committerJoey Hess2016-06-20 13:48:54 -0400
commita0d9ebf0334c98be75d18fd83d860ec7370a8005 (patch)
treeb5b93bbe6b32e4c5c4af450a028a1f16f57f789b /src/Propellor/Exception.hs
parentf0fbdce8fd8369eaa78dfff02aca79fb61170931 (diff)
parent255a52c13ccb0e78744c32c7cbb169682e2b947a (diff)
Merge remote-tracking branch 'felix/derivedatatypeable-exception'
Diffstat (limited to 'src/Propellor/Exception.hs')
-rw-r--r--src/Propellor/Exception.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Propellor/Exception.hs b/src/Propellor/Exception.hs
index 2e8754dc..463402e4 100644
--- a/src/Propellor/Exception.hs
+++ b/src/Propellor/Exception.hs
@@ -13,6 +13,7 @@ import Control.Exception (SomeAsyncException)
#endif
import Control.Monad.Catch
import Control.Monad.IO.Class (MonadIO)
+import Prelude
-- | Catches all exceptions (except for `StopPropellorException` and
-- `AsyncException` and `SomeAsyncException`) and returns FailedChange.
@@ -34,4 +35,4 @@ catchPropellor' a onerr = a `catches`
-- | Catches all exceptions (except for `StopPropellorException` and
-- `AsyncException`).
tryPropellor :: MonadCatch m => m a -> m (Either SomeException a)
-tryPropellor a = (Right <$> a) `catchPropellor'` (pure . Left)
+tryPropellor a = (return . Right =<< a) `catchPropellor'` (return . Left)