Fix deprecation warnings with latest versions of yaml
parent
4cb3b96f07
commit
0b40dd7c32
|
@ -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?
|
||||
)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue