Fix config printing (config file generation)
parent
ed10137174
commit
00c7384d20
|
@ -154,4 +154,4 @@ readMergePersConfig path shouldCreate conf = do
|
||||||
showConfigYaml :: Config -> String
|
showConfigYaml :: Config -> String
|
||||||
showConfigYaml = Data.ByteString.Char8.unpack
|
showConfigYaml = Data.ByteString.Char8.unpack
|
||||||
. Data.Yaml.encode
|
. 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
|
parseJSON = fmap (cMap Option) . parseJSON
|
||||||
#define makeToJSONMaybe(type)\
|
#define makeToJSONMaybe(type)\
|
||||||
instance ToJSON (type Maybe) where\
|
instance ToJSON (type Maybe) where\
|
||||||
|
toJSON = Aeson.genericToJSON aesonDecodeOptionsBrittany;\
|
||||||
toEncoding = Aeson.genericToEncoding aesonDecodeOptionsBrittany
|
toEncoding = Aeson.genericToEncoding aesonDecodeOptionsBrittany
|
||||||
#define makeToJSONOption(type)\
|
#define makeToJSONOption(type)\
|
||||||
instance ToJSON (type Option) where\
|
instance ToJSON (type Option) where\
|
||||||
|
toJSON = toJSON . cMap getOption;\
|
||||||
toEncoding = toEncoding . cMap getOption
|
toEncoding = toEncoding . cMap getOption
|
||||||
|
|
||||||
makeFromJSON(ErrorHandlingConfigFMaybe)
|
makeFromJSON(ErrorHandlingConfigFMaybe)
|
||||||
|
|
Loading…
Reference in New Issue