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 /Command/Status.hs | |
parent | 20259c2955e408a72e0960207fc8be4cbeec2e21 (diff) |
code simplification thanks to applicative functors
Diffstat (limited to 'Command/Status.hs')
-rw-r--r-- | Command/Status.hs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Command/Status.hs b/Command/Status.hs index aef4df232..5c82744b1 100644 --- a/Command/Status.hs +++ b/Command/Status.hs @@ -8,6 +8,7 @@ module Command.Status where import Control.Monad.State +import Control.Applicative import Data.Maybe import System.IO import Data.List @@ -112,12 +113,10 @@ total_annex_size = stat "total annex size" $ cachedKeysReferenced >>= keySizeSum local_annex_keys :: Stat -local_annex_keys = stat "local annex keys" $ - return . show . snd =<< cachedKeysPresent +local_annex_keys = stat "local annex keys" $ show . snd <$> cachedKeysPresent total_annex_keys :: Stat -total_annex_keys = stat "total annex keys" $ - return . show . snd =<< cachedKeysReferenced +total_annex_keys = stat "total annex keys" $ show . snd <$> cachedKeysReferenced tmp_size :: Stat tmp_size = staleSize "temporary directory size" gitAnnexTmpDir @@ -126,8 +125,7 @@ bad_data_size :: Stat bad_data_size = staleSize "bad keys size" gitAnnexBadDir backend_usage :: Stat -backend_usage = stat "backend usage" $ - return . usage =<< cachedKeysReferenced +backend_usage = stat "backend usage" $ usage <$> cachedKeysReferenced where usage (ks, _) = pp "" $ sort $ map swap $ splits ks splits :: [Key] -> [(String, Integer)] |