I used the answer in json_answer (Text.JSON package) and I've got a generic json Haskell data type. It's ok to define a custom Haskell data type for certain data, but if the data I want to parse is uncertain,
For example, if I got a response A from some APIs, the field is "category" this time:
[JSObject (JSONObject {fromJSObject = [("category",JSString (JSONString {fromJSString = "photo"}))]})]
And next time, "address":
[JSObject (JSONObject {fromJSObject = [("address",JSString (JSONString {fromJSString = "http://www.example.com"}))]})]
or some other uncertain fields, and the generic json type may be nested.
how can I extract it from the json data type?
Thanks for your help.