by maxpow4h · 13y ago · 0 comments
data MetaData = MetaData {
metadataUrl :: String,
metadataTitle :: String ...
you can use import Data.Char
...
upStr n s = toLower (head (drop n s)) : (drop (n+1) s)
$(deriveJSON (upStr 8) ''MetaData)
This will splice the `metadataUrl` to use the `url` field from JSON. The deriveJSON function takes a function to change the field names.It's pretty handy.
No comments yet.