Closed kfl closed 10 years ago
Thanks a lot!
The issues should reopened. Because the fix broke the protocol between the server and the browser.
The reason is that genericToJSON encode sum types different from Data.Aeson.Generic
.
For instance, Data.Aeson.Generic
encode an instruction as:
{"RunJSFunction":"elidToElement(\"*2:canvas\").getContext('2d').fill()"}
Whereas genericToJSON
encode it as:
{"contents":"elidToElement(\"*2:canvas\").getContext('2d').fill()","tag":"RunJSFunction"}
Unfortunately there does not seem to be a way to configure genericToJSON
to behave like Data.Aeson.Generic
.
Ah, I see, thanks! And now I remember why I've put up with that warning instead of switching to Generics. :smile:
The correct way to solve this problem is to make an explicit instance of ToJSON
, thus specifying the serialization format.
I think it might be cleaner to fix it in driver.js
which I'm looking into right now.
To get rid of the warnings from
aeson
aboutData.Aeson.Generic
being deprecated.