clean up read/show abuse
Avoid ever using read to parse a non-haskell formatted input string. show :: Key is arguably still show abuse, but displaying Keys as filenames is just too useful to give up.
This commit is contained in:
parent
fdf988be6d
commit
b11a63a860
18 changed files with 75 additions and 98 deletions
|
@ -178,7 +178,7 @@ fileKey1 file = readKey1 $
|
|||
replace "&a" "&" $ replace "&s" "%" $ replace "%" "/" file
|
||||
|
||||
writeLog1 :: FilePath -> [LogLine] -> IO ()
|
||||
writeLog1 file ls = viaTmp writeFile file (unlines $ map show ls)
|
||||
writeLog1 file ls = viaTmp writeFile file (showLog ls)
|
||||
|
||||
readLog1 :: FilePath -> IO [LogLine]
|
||||
readLog1 file = catch (parseLog <$> readFileStrict file) (const $ return [])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue