Fix config printing (config file generation)

pull/35/head
Lennart Spitzner 2017-03-07 21:14:41 +01:00
parent ed10137174
commit 00c7384d20
2 changed files with 3 additions and 1 deletions

View File

@ -154,4 +154,4 @@ readMergePersConfig path shouldCreate conf = do
showConfigYaml :: Config -> String
showConfigYaml = Data.ByteString.Char8.unpack
. Data.Yaml.encode
. cMap (\(Identity x) -> Option (Just x))
. cMap (\(Identity x) -> Just x)

View File

@ -163,9 +163,11 @@ aesonDecodeOptionsBrittany = Aeson.defaultOptions
parseJSON = fmap (cMap Option) . parseJSON
#define makeToJSONMaybe(type)\
instance ToJSON (type Maybe) where\
toJSON = Aeson.genericToJSON aesonDecodeOptionsBrittany;\
toEncoding = Aeson.genericToEncoding aesonDecodeOptionsBrittany
#define makeToJSONOption(type)\
instance ToJSON (type Option) where\
toJSON = toJSON . cMap getOption;\
toEncoding = toEncoding . cMap getOption
makeFromJSON(ErrorHandlingConfigFMaybe)