I am working on a simple Haskell program that retrieves a JSON string from a server, parses it, and does something with the data. The specifics are not very relevant at the moment, the problem I encountered is parsing the JSON that is returned.
I get a JSON string from the server as an IO String type and cannot figure out how to parse this into a JSON object.
Any help would be greatly appreciated :)
Here is my code.
import Data.Aeson import Network.HTTP main = do src <- openURL "http://www.reddit.com/user/chrissalij/about.json" -- Json parsing code goes here openURL url = getResponseBody =<< simpleHTTP (getRequest url)
Note: I am using Data.Aeson in the example, since this is what seems recommended, however I would more than like to use another library.
Also, any and all of this code can be changed. If you get
source share