aboutsummaryrefslogtreecommitdiff
path: root/Config.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-08-25 00:28:55 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-08-25 01:27:19 -0400
commit678726c10c13481c082743808a5188d28567e2b3 (patch)
treea5052eb5b20444e10d3f5d467281ef4c0f5975d1 /Config.hs
parent20259c2955e408a72e0960207fc8be4cbeec2e21 (diff)
code simplification thanks to applicative functors
Diffstat (limited to 'Config.hs')
-rw-r--r--Config.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/Config.hs b/Config.hs
index 12f648047..b4f4c0b92 100644
--- a/Config.hs
+++ b/Config.hs
@@ -9,7 +9,7 @@ module Config where
import Data.Maybe
import Control.Monad.State (liftIO)
-import Control.Monad (liftM)
+import Control.Applicative
import System.Cmd.Utils
import qualified Git
@@ -47,8 +47,8 @@ remoteConfig r key = "remote." ++ fromMaybe "" (Git.repoRemoteName r) ++ ".annex
remoteCost :: Git.Repo -> Int -> Annex Int
remoteCost r def = do
cmd <- getConfig r "cost-command" ""
- return . safeparse =<< if not $ null cmd
- then liftM snd $ liftIO $ pipeFrom "sh" ["-c", cmd]
+ safeparse <$> if not $ null cmd
+ then liftIO $ snd <$> pipeFrom "sh" ["-c", cmd]
else getConfig r "cost" ""
where
safeparse v