Fix deprecation warnings with latest versions of yaml

pull/160/head
Lennart Spitzner 2018-07-04 21:14:06 +02:00
parent 4cb3b96f07
commit 0b40dd7c32
2 changed files with 4 additions and 3 deletions

View File

@ -122,7 +122,8 @@ extractCommentConfigs anns (TopLevelDeclNameMap declNameMap) = do
, \s -> "{" `isPrefixOf` dropWhile (== ' ') s
, Butcher.addCmdPart (Butcher.varPartDesc "yaml-config-document")
$ fmap (\lconf -> (mempty { _conf_layout = lconf }, ""))
. Data.Yaml.decode
. either (\_ -> Nothing) Just
. Data.Yaml.decodeEither'
. Data.ByteString.Char8.pack
-- TODO: use some proper utf8 encoder instead?
)

View File

@ -235,14 +235,14 @@ readConfig path = do
if exists
then do
contents <- liftIO $ ByteString.readFile path -- no lazy IO, tyvm.
fileConf <- case Data.Yaml.decodeEither contents of
fileConf <- case Data.Yaml.decodeEither' contents of
Left e -> do
liftIO
$ putStrErrLn
$ "error reading in brittany config from "
++ path
++ ":"
liftIO $ putStrErrLn e
liftIO $ putStrErrLn (Data.Yaml.prettyPrintParseException e)
mzero
Right x -> return x
return $ Just fileConf