Safe Haskell | None |
---|---|
Language | Haskell2010 |
Utils for using aeson's deriveJSON with lens's makeFields
- deriveApiFieldJSON :: Name -> Q [Dec]
How to use this library
data SomeQuery = SomeQuery { _someQueryPage :: Int , _someQueryText :: String } deriving (Eq, Show) makeFields ''SomeQuery deriveApiFieldJSON ''SomeQuery
This is compatible with the next json
{"page": 3, "text": "foo"}
deriveApiFieldJSON :: Name -> Q [Dec] Source
レコード名を落としてjsonインスタンス化