
14 Nov
2013
14 Nov
'13
5:22 a.m.
Hello everyone, I'd use aeson to parse JSON. I did much of the translation JSon in Haskell data but I'm stuck on one point. Suppose I have a JSon object that is in this form: {\"Ports\":{\"22/tcp\":[{\"HostIp\":\"0.0.0.0\",\"HostPort\":\"49154\"}],\"80/tcp\":[{\"HostIp\":\"0.0.0.0\",\"HostPort\":\"49155\"}]} I do not know how to "bind" the key name and value knowing that the key changes name "randomly". Example with port 21 and port 8888: {\"Ports\":{\"21/tcp\":[{\"HostIp\":\"0.0.0.0\",\"HostPort\":\"49154\"}],\"8888/tcp\":[{\"HostIp\":\"0.0.0.0\",\"HostPort\":\"49155\"}]}} All code : http://lpaste.net/95607 Thank you for your help.