remove some partial functions
A few were too hard to get rid of, and safe since the code does check for an empty line.
This commit is contained in:
parent
817b1936e6
commit
b7e0d39abb
1 changed files with 5 additions and 5 deletions
|
@ -64,15 +64,15 @@ parseLog parser = M.fromListWith best . mapMaybe parse . lines
|
||||||
where
|
where
|
||||||
makepair v = Just (toUUID u, LogEntry ts v)
|
makepair v = Just (toUUID u, LogEntry ts v)
|
||||||
ws = words line
|
ws = words line
|
||||||
u = head ws
|
u = Prelude.head ws
|
||||||
end = last ws
|
t = Prelude.last ws
|
||||||
ts
|
ts
|
||||||
| tskey `isPrefixOf` end =
|
| tskey `isPrefixOf` t =
|
||||||
pdate $ tail $ dropWhile (/= '=') end
|
pdate $ drop 1 $ dropWhile (/= '=') t
|
||||||
| otherwise = Unknown
|
| otherwise = Unknown
|
||||||
info
|
info
|
||||||
| ts == Unknown = drop 1 ws
|
| ts == Unknown = drop 1 ws
|
||||||
| otherwise = drop 1 $ init ws
|
| otherwise = drop 1 $ beginning ws
|
||||||
pdate s = case parseTime defaultTimeLocale "%s%Qs" s of
|
pdate s = case parseTime defaultTimeLocale "%s%Qs" s of
|
||||||
Nothing -> Unknown
|
Nothing -> Unknown
|
||||||
Just d -> Date $ utcTimeToPOSIXSeconds d
|
Just d -> Date $ utcTimeToPOSIXSeconds d
|
||||||
|
|
Loading…
Reference in a new issue