simplify Show instance by deriving
This commit is contained in:
parent
11f4d993b5
commit
de4980ef85
2 changed files with 2 additions and 5 deletions
|
@ -24,7 +24,7 @@ import qualified Data.Attoparsec.ByteString.Lazy as A
|
||||||
-- | Some very old logs did not have any time stamp at all;
|
-- | Some very old logs did not have any time stamp at all;
|
||||||
-- Unknown is used for those.
|
-- Unknown is used for those.
|
||||||
data VectorClock = Unknown | VectorClock POSIXTime
|
data VectorClock = Unknown | VectorClock POSIXTime
|
||||||
deriving (Eq, Ord)
|
deriving (Eq, Ord, Show)
|
||||||
|
|
||||||
-- Unknown is oldest.
|
-- Unknown is oldest.
|
||||||
prop_VectorClock_sane :: Bool
|
prop_VectorClock_sane :: Bool
|
||||||
|
|
|
@ -26,10 +26,7 @@ data LogLine = LogLine
|
||||||
{ date :: VectorClock
|
{ date :: VectorClock
|
||||||
, status :: LogStatus
|
, status :: LogStatus
|
||||||
, info :: LogInfo
|
, info :: LogInfo
|
||||||
} deriving (Eq)
|
} deriving (Eq, Show)
|
||||||
|
|
||||||
instance Show LogLine where
|
|
||||||
show l = "LogLine " ++ formatVectorClock (date l) ++ " " ++ show (status l) ++ " " ++ show (info l)
|
|
||||||
|
|
||||||
data LogStatus = InfoPresent | InfoMissing | InfoDead
|
data LogStatus = InfoPresent | InfoMissing | InfoDead
|
||||||
deriving (Eq, Show, Bounded, Enum)
|
deriving (Eq, Show, Bounded, Enum)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue