úÎdNone!5:_gMerge values together. Useful for creating compound JSON structures that should be parsed as one object ÿ­data A = A { one :: String, two :: String } deriving (Show, Eq, Generic) instance ToJSON A instance FromJSON A data B = B { three :: String } deriving (Show, Eq, Generic) instance ToJSON B instance FromJSON B data AB = AB A B deriving (Show, Eq) instance ToJSON AB where toJSON (AB a b) = merge [toJSON a, toJSON b] instance FromJSON AB where parseJSON o = do a <- parseJSON o b <- parseJSON o return $ AB a bISerialize a sumtype to a flat object, rather than to "tag" and "contents" hdata C = CA A | CB B deriving (Show, Eq, Generic) instance ToJSON C where toJSON x = flatToJSON "c" x{"c": CA), "one": "value", "two": "value"} {"c": CB, "three": "value"}oDeserialize a sumtype from a flat object > > instance FromJSON C where > parseJSON x = flatParseJSON "c" x'aeson-flat-0.1.1-GrJgyb1UEpLHexmcor1nEDData.Aeson.Flatmerge flatToJSON flatParseJSON fieldToJSONfieldParseJSON