summaryrefslogtreecommitdiff
path: root/src/Data/Torrent.hs
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2013-12-01 12:32:49 -0800
committerSam Truzjan <pxqr.sta@gmail.com>2013-12-01 12:32:49 -0800
commitf4fcc6c1970ec8d63e185e49dff65a6bd77011ad (patch)
tree5472de9cdb8afd6b15752f796ece829bf9e0316a /src/Data/Torrent.hs
parent2749007675a6ff28979fa793b48ffe910635c708 (diff)
parent5dc7a19e42da1ee1cc3570ca74a55c32d7d243e0 (diff)
Merge pull request #2 from DanielG/master
Fix building with aeson >= 0.6.2.0
Diffstat (limited to 'src/Data/Torrent.hs')
-rw-r--r--src/Data/Torrent.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Data/Torrent.hs b/src/Data/Torrent.hs
index b3ac7586..ce919907 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
128makeLensesFor 128makeLensesFor
129 [ ("idInfoHash" , "infohash" ) 129 [ ("idInfoHash" , "infohash" )
@@ -137,8 +137,8 @@ instance NFData InfoDict where
137 rnf InfoDict {..} = rnf idLayoutInfo 137 rnf InfoDict {..} = rnf idLayoutInfo
138 138
139instance Hashable InfoDict where 139instance Hashable InfoDict where
140 hash = Hashable.hash . idInfoHash 140 hashWithSalt = Hashable.hashUsing idInfoHash
141 {-# INLINE hash #-} 141 {-# INLINE hashWithSalt #-}
142 142
143-- | Smart constructor: add a info hash to info dictionary. 143-- | Smart constructor: add a info hash to info dictionary.
144infoDictionary :: LayoutInfo -> PieceInfo -> Bool -> InfoDict 144infoDictionary :: LayoutInfo -> PieceInfo -> Bool -> InfoDict
@@ -239,7 +239,7 @@ instance ToJSON NominalDiffTime where
239instance FromJSON NominalDiffTime where 239instance 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
244makeLensesFor 244makeLensesFor
245 [ ("tAnnounce" , "announce" ) 245 [ ("tAnnounce" , "announce" )