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;
|
||||
-- Unknown is used for those.
|
||||
data VectorClock = Unknown | VectorClock POSIXTime
|
||||
deriving (Eq, Ord)
|
||||
deriving (Eq, Ord, Show)
|
||||
|
||||
-- Unknown is oldest.
|
||||
prop_VectorClock_sane :: Bool
|
||||
|
|
|
@ -26,10 +26,7 @@ data LogLine = LogLine
|
|||
{ date :: VectorClock
|
||||
, status :: LogStatus
|
||||
, info :: LogInfo
|
||||
} deriving (Eq)
|
||||
|
||||
instance Show LogLine where
|
||||
show l = "LogLine " ++ formatVectorClock (date l) ++ " " ++ show (status l) ++ " " ++ show (info l)
|
||||
} deriving (Eq, Show)
|
||||
|
||||
data LogStatus = InfoPresent | InfoMissing | InfoDead
|
||||
deriving (Eq, Show, Bounded, Enum)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue