aboutsummaryrefslogtreecommitdiff
path: root/Logs/Presence
diff options
context:
space:
mode:
Diffstat (limited to 'Logs/Presence')
-rw-r--r--Logs/Presence/Pure.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/Logs/Presence/Pure.hs b/Logs/Presence/Pure.hs
index ffeb78b26..6bf36d883 100644
--- a/Logs/Presence/Pure.hs
+++ b/Logs/Presence/Pure.hs
@@ -30,14 +30,16 @@ parseLog = mapMaybe parseline . lines
where
parseline l = LogLine
<$> (utcTimeToPOSIXSeconds <$> parseTime defaultTimeLocale "%s%Qs" d)
- <*> parsestatus s
+ <*> parseStatus s
<*> pure rest
where
(d, pastd) = separate (== ' ') l
(s, rest) = separate (== ' ') pastd
- parsestatus "1" = Just InfoPresent
- parsestatus "0" = Just InfoMissing
- parsestatus _ = Nothing
+
+parseStatus :: String -> Maybe LogStatus
+parseStatus "1" = Just InfoPresent
+parseStatus "0" = Just InfoMissing
+parseStatus _ = Nothing
{- Generates a log file. -}
showLog :: [LogLine] -> String