Fix config printing (config file generation)
parent
ed10137174
commit
00c7384d20
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue