diff options
author | Joey Hess <joey@kitenet.net> | 2011-08-25 00:28:55 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-08-25 01:27:19 -0400 |
commit | 678726c10c13481c082743808a5188d28567e2b3 (patch) | |
tree | a5052eb5b20444e10d3f5d467281ef4c0f5975d1 /Config.hs | |
parent | 20259c2955e408a72e0960207fc8be4cbeec2e21 (diff) |
code simplification thanks to applicative functors
Diffstat (limited to 'Config.hs')
-rw-r--r-- | Config.hs | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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 |