Show yaml representation when dumping config

pull/3/head
Lennart Spitzner 2016-08-08 17:46:02 +02:00
parent 1a70e4d949
commit 6011726389
2 changed files with 7 additions and 1 deletions

View File

@ -99,7 +99,7 @@ mainCmdParser = do
Nothing -> System.Exit.exitWith (System.Exit.ExitFailure 50)
Just x -> return x
when (confUnpack $ _dconf_dump_config $ _conf_debug $ config) $ do
trace (showTree config) $ return ()
trace (showConfigYaml config) $ return ()
let ghcOptions = config
& _conf_forward
& _options_ghc

View File

@ -8,6 +8,7 @@ module Language.Haskell.Brittany.Config
, configParser
, staticDefaultConfig
, readMergePersConfig
, showConfigYaml
)
where
@ -177,3 +178,8 @@ readMergePersConfig path shouldCreate conf = do
return $ conf
| otherwise -> do
return conf
showConfigYaml :: Config -> String
showConfigYaml = Data.ByteString.Char8.unpack
. Data.Yaml.encode
. cMap (\(Identity x) -> Just x)