diff options
author | Joey Hess <joey@kitenet.net> | 2014-07-24 17:18:14 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-07-24 17:18:14 -0400 |
commit | 956807053d627355157f1df51667b2a61f57ab60 (patch) | |
tree | a5eac2d161bf483a5e50f88f9cbab62b080ad0c1 /Logs | |
parent | f2dc261406dc825c6a2e8306d3f7bbc507ecc63f (diff) |
improve a bit
Diffstat (limited to 'Logs')
-rw-r--r-- | Logs/Chunk/Pure.hs | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Logs/Chunk/Pure.hs b/Logs/Chunk/Pure.hs index 09e871c38..9bbfb868c 100644 --- a/Logs/Chunk/Pure.hs +++ b/Logs/Chunk/Pure.hs @@ -5,7 +5,13 @@ - Licensed under the GNU GPL version 3 or higher. -} -module Logs.Chunk.Pure where +module Logs.Chunk.Pure + ( ChunkSize + , ChunkCount + , ChunkLog + , parseLog + , showLog + ) where import Common.Annex import Logs.MapLog @@ -21,12 +27,15 @@ parseLog :: String -> ChunkLog parseLog = parseMapLog fieldparser valueparser where fieldparser s = - let (u,sz) = separate (== ':') s + let (u,sz) = separate (== sep) s in (,) <$> pure (toUUID u) <*> readish sz valueparser = readish showLog :: ChunkLog -> String showLog = showMapLog fieldshower valueshower where - fieldshower (u, sz) = fromUUID u ++ ':' : show sz + fieldshower (u, sz) = fromUUID u ++ sep : show sz valueshower = show + +sep :: Char +sep = ':' |