I have a data:
data MyData = MyData { a :: String, b :: Integer, c :: Bool }
deriving (Generic)
instance FromJSON MyData
instance ToJSON MyData
In fact, I have many more fields in MyData
.
I want to parse 1 or 2 fields manually because in MyData
they're called slightly different than in the real JSON object, while still being able to have FromJSON
and ToJSON
or something like that. Is it possible? Or should I in this case parse all the fields manually and not use FromJSON
/ ToJSON
?