How do I parse a JSON in Haskell where the name of the fields can be one of multiple values, but should be converted into a single Haskell type?
Let's say I have the following JSON values. { "fieldName1": 5, "value1": "Hello" } and { "fieldName2": 7, "value1": "Welcome" } I have the following type in Haskell. data Greeting = Greeting { count :: Int, name :: Text }…