(i wrote the initial happstack webserver very ad-hoc and when i started thinking i might want to support JSON, for map generation initially, i just kinda grabbed some packages off of hackage and ended up with both
(all of this is a very roundabout way of saying that for a very long time my json was double-encoded: when it was sent out as a response body i did
(this all ended with me writing a
Data.Aeson and Text.JSON despite how they both do the exact same thing (codify json in haskell). so aeson is... either hooked up into happstack natively, or at least much _easier_ to hook up into happstack, but w/e when i was putting this together i didn't know any of that.)(all of this is a very roundabout way of saying that for a very long time my json was double-encoded: when it was sent out as a response body i did
Data.Aeson.encode . Text.JSON.encode, and i only noticed i did this -- and that it was weird -- when i started digging into the specific guts of the event api, since... if i output null it would come out as "null", and the more complex events were a mess of backslashes due to being escaped into a string. and i had to manually call JSON.decode on the javascript end.)(this all ended with me writing a
ToJson (from aeson) instance for JSObject (from text.json), just transliterating one form of json encoding to another one. probably at some point i should go in there and pull out all the text.json bits & get rid of that dependency.)