avoid accidental Show of VectorClock

Removed its Show instance.
This commit is contained in:
Joey Hess 2017-08-14 14:43:56 -04:00
parent 2cecc8d2a3
commit 0b307f43e1
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
6 changed files with 29 additions and 27 deletions

View file

@ -21,7 +21,7 @@ import Utility.QuickCheck
-- | Some very old logs did not have any time stamp at all;
-- Unknown is used for those.
data VectorClock = Unknown | VectorClock POSIXTime
deriving (Eq, Ord, Show)
deriving (Eq, Ord)
-- Unknown is oldest.
prop_VectorClock_sane :: Bool
@ -37,3 +37,10 @@ currentVectorClock = go =<< getEnv "GIT_ANNEX_VECTOR_CLOCK"
go (Just s) = case parsePOSIXTime s of
Just t -> return (VectorClock t)
Nothing -> VectorClock <$> getPOSIXTime
formatVectorClock :: VectorClock -> String
formatVectorClock Unknown = "0"
formatVectorClock (VectorClock t) = show t
parseVectorClock :: String -> Maybe VectorClock
parseVectorClock t = VectorClock <$> parsePOSIXTime t