summaryrefslogtreecommitdiff
path: root/src/Propellor/Exception.hs
diff options
context:
space:
mode:
authorFélix Sipma2016-06-20 16:25:34 +0200
committerFélix Sipma2016-06-20 16:25:52 +0200
commitc5a1503c0c2eb1974e6d3491db61ed75ce2ddd61 (patch)
tree9ec4a9d688f93c1a6f370740a6aad54b2d37ce53 /src/Propellor/Exception.hs
parentc10ec2d3eb3b4195cc0d2234d2ac227dbd43629c (diff)
Exception: prevent use of Control.Applicative (ghc compatibility)
Diffstat (limited to 'src/Propellor/Exception.hs')
-rw-r--r--src/Propellor/Exception.hs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/Propellor/Exception.hs b/src/Propellor/Exception.hs
index b297a740..49977370 100644
--- a/src/Propellor/Exception.hs
+++ b/src/Propellor/Exception.hs
@@ -10,7 +10,6 @@ import Utility.Exception
import Control.Exception (AsyncException)
import Control.Monad.Catch
import Control.Monad.IO.Class (MonadIO)
-import Control.Applicative
import Prelude
-- | Catches all exceptions (except for `StopPropellorException` and
@@ -30,4 +29,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 = fmap Right a `catchPropellor'` (return . Left)