diff options
author | Daniel Gröber <dxld@darkboxed.org> | 2013-12-01 21:12:40 +0100 |
---|---|---|
committer | Daniel Gröber <dxld@darkboxed.org> | 2013-12-01 21:12:40 +0100 |
commit | b83c5d53be21c03004ebb65d1dc9fe1f841a2a3c (patch) | |
tree | 12d58df47e8b1a52173c72e97d29d3b8046fa309 /src/Data/Torrent.hs | |
parent | 2749007675a6ff28979fa793b48ffe910635c708 (diff) |
Fix building with aeson >= 0.6.2.0
deriveJSON now takes an Option record instead of a single function. It might be
nicer to define a function that takes the fieldLabelModifier function rather
than doing it inline everywhere but I didn't know where a good place to put that
would be.
Diffstat (limited to 'src/Data/Torrent.hs')
-rw-r--r-- | src/Data/Torrent.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Data/Torrent.hs b/src/Data/Torrent.hs index b3ac7586..7469d621 100644 --- a/src/Data/Torrent.hs +++ b/src/Data/Torrent.hs | |||
@@ -123,7 +123,7 @@ data InfoDict = InfoDict | |||
123 | -- BEP 27: <http://www.bittorrent.org/beps/bep_0027.html> | 123 | -- BEP 27: <http://www.bittorrent.org/beps/bep_0027.html> |
124 | } deriving (Show, Read, Eq, Typeable) | 124 | } deriving (Show, Read, Eq, Typeable) |
125 | 125 | ||
126 | $(deriveJSON (L.map Char.toLower . L.dropWhile isLower) ''InfoDict) | 126 | $(deriveJSON defaultOptions { fieldLabelModifier = (L.map Char.toLower . L.dropWhile isLower) } ''InfoDict) |
127 | 127 | ||
128 | makeLensesFor | 128 | makeLensesFor |
129 | [ ("idInfoHash" , "infohash" ) | 129 | [ ("idInfoHash" , "infohash" ) |
@@ -239,7 +239,7 @@ instance ToJSON NominalDiffTime where | |||
239 | instance FromJSON NominalDiffTime where | 239 | instance FromJSON NominalDiffTime where |
240 | parseJSON v = utcTimeToPOSIXSeconds <$> parseJSON v | 240 | parseJSON v = utcTimeToPOSIXSeconds <$> parseJSON v |
241 | 241 | ||
242 | $(deriveJSON (L.map Char.toLower . L.dropWhile isLower) ''Torrent) | 242 | $(deriveJSON defaultOptions { fieldLabelModifier = (L.map Char.toLower . L.dropWhile isLower) } ''Torrent) |
243 | 243 | ||
244 | makeLensesFor | 244 | makeLensesFor |
245 | [ ("tAnnounce" , "announce" ) | 245 | [ ("tAnnounce" , "announce" ) |