Revision c2e136e2
ID | c2e136e2056ff59df185c5b68a62ebf1a8466576 |
Parent | 1d4febbd |
Child | 58b37916 |
Enhance DictObject and refactor loading/saving TH functions
Since there is already `DictObject` type class which could share code
with generated instances of `showJSON`, the generated code is split into
two parts: One that converts between `[(String, JSValue)]` and the data
type and another that uses `DictObject` instance to implement `showJSON`
and `readJSON`.
This removes code duplication between the two and naturally adds
`fromDict` to `DictObject`.
Also let loading functions be of type `Q Exp` instead of less flexible
`Q (Name, Stmt)`.
While at it, fix also `map (uncurry ..) (zip ..)` into `zipWith` at
several places.
Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Files
- added
- modified
- copied
- renamed
- deleted