diff options
Diffstat (limited to 'src/Data/Torrent')
-rw-r--r-- | src/Data/Torrent/Block.hs | 2 | ||||
-rw-r--r-- | src/Data/Torrent/InfoHash.hs | 4 | ||||
-rw-r--r-- | src/Data/Torrent/Layout.hs | 4 | ||||
-rw-r--r-- | src/Data/Torrent/Piece.hs | 4 | ||||
-rw-r--r-- | src/Data/Torrent/Progress.hs | 2 |
5 files changed, 8 insertions, 8 deletions
diff --git a/src/Data/Torrent/Block.hs b/src/Data/Torrent/Block.hs index 1e0a929d..089217fa 100644 --- a/src/Data/Torrent/Block.hs +++ b/src/Data/Torrent/Block.hs | |||
@@ -100,7 +100,7 @@ data BlockIx = BlockIx { | |||
100 | , ixLength :: {-# UNPACK #-} !BlockSize | 100 | , ixLength :: {-# UNPACK #-} !BlockSize |
101 | } deriving (Show, Eq, Typeable) | 101 | } deriving (Show, Eq, Typeable) |
102 | 102 | ||
103 | $(deriveJSON (L.map toLower . L.dropWhile isLower) ''BlockIx) | 103 | $(deriveJSON defaultOptions { fieldLabelModifier = (L.map toLower . L.dropWhile isLower) } ''BlockIx) |
104 | 104 | ||
105 | getInt :: S.Get Int | 105 | getInt :: S.Get Int |
106 | getInt = fromIntegral <$> S.getWord32be | 106 | getInt = fromIntegral <$> S.getWord32be |
diff --git a/src/Data/Torrent/InfoHash.hs b/src/Data/Torrent/InfoHash.hs index d840ac87..4d49fcb7 100644 --- a/src/Data/Torrent/InfoHash.hs +++ b/src/Data/Torrent/InfoHash.hs | |||
@@ -70,8 +70,8 @@ instance Default InfoHash where | |||
70 | 70 | ||
71 | -- | Hash raw bytes. (no encoding) | 71 | -- | Hash raw bytes. (no encoding) |
72 | instance Hashable InfoHash where | 72 | instance Hashable InfoHash where |
73 | hash (InfoHash ih) = Hashable.hash ih | 73 | hashWithSalt s (InfoHash ih) = hashWithSalt s ih |
74 | {-# INLINE hash #-} | 74 | {-# INLINE hashWithSalt #-} |
75 | 75 | ||
76 | -- | Convert to\/from raw bencoded string. (no encoding) | 76 | -- | Convert to\/from raw bencoded string. (no encoding) |
77 | instance BEncode InfoHash where | 77 | instance BEncode InfoHash where |
diff --git a/src/Data/Torrent/Layout.hs b/src/Data/Torrent/Layout.hs index 54ec0f23..c1e26d48 100644 --- a/src/Data/Torrent/Layout.hs +++ b/src/Data/Torrent/Layout.hs | |||
@@ -125,7 +125,7 @@ data FileInfo a = FileInfo { | |||
125 | , Functor, Foldable | 125 | , Functor, Foldable |
126 | ) | 126 | ) |
127 | 127 | ||
128 | $(deriveJSON (L.map Char.toLower . L.dropWhile isLower) ''FileInfo) | 128 | $(deriveJSON defaultOptions { fieldLabelModifier = (L.map Char.toLower . L.dropWhile isLower) } ''FileInfo) |
129 | 129 | ||
130 | makeLensesFor | 130 | makeLensesFor |
131 | [ ("fiLength", "fileLength") | 131 | [ ("fiLength", "fileLength") |
@@ -210,7 +210,7 @@ data LayoutInfo | |||
210 | , liDirName :: !ByteString | 210 | , liDirName :: !ByteString |
211 | } deriving (Show, Read, Eq, Typeable) | 211 | } deriving (Show, Read, Eq, Typeable) |
212 | 212 | ||
213 | $(deriveJSON (L.map Char.toLower . L.dropWhile isLower) ''LayoutInfo) | 213 | $(deriveJSON defaultOptions { fieldLabelModifier = (L.map Char.toLower . L.dropWhile isLower) } ''LayoutInfo) |
214 | 214 | ||
215 | makeLensesFor | 215 | makeLensesFor |
216 | [ ("liFile" , "singleFile" ) | 216 | [ ("liFile" , "singleFile" ) |
diff --git a/src/Data/Torrent/Piece.hs b/src/Data/Torrent/Piece.hs index c6223348..31680ce8 100644 --- a/src/Data/Torrent/Piece.hs +++ b/src/Data/Torrent/Piece.hs | |||
@@ -118,7 +118,7 @@ data Piece a = Piece | |||
118 | , pieceData :: !a | 118 | , pieceData :: !a |
119 | } deriving (Show, Read, Eq, Functor, Typeable) | 119 | } deriving (Show, Read, Eq, Functor, Typeable) |
120 | 120 | ||
121 | $(deriveJSON (L.map toLower . L.dropWhile isLower) ''Piece) | 121 | $(deriveJSON defaultOptions { fieldLabelModifier = (L.map toLower . L.dropWhile isLower) } ''Piece) |
122 | 122 | ||
123 | instance NFData (Piece a) | 123 | instance NFData (Piece a) |
124 | 124 | ||
@@ -161,7 +161,7 @@ data PieceInfo = PieceInfo | |||
161 | -- ^ Concatenation of all 20-byte SHA1 hash values. | 161 | -- ^ Concatenation of all 20-byte SHA1 hash values. |
162 | } deriving (Show, Read, Eq, Typeable) | 162 | } deriving (Show, Read, Eq, Typeable) |
163 | 163 | ||
164 | $(deriveJSON (L.map toLower . L.dropWhile isLower) ''PieceInfo) | 164 | $(deriveJSON defaultOptions { fieldLabelModifier = (L.map toLower . L.dropWhile isLower) } ''PieceInfo) |
165 | 165 | ||
166 | -- | Number of bytes in each piece. | 166 | -- | Number of bytes in each piece. |
167 | makeLensesFor [("piPieceLength", "pieceLength")] ''PieceInfo | 167 | makeLensesFor [("piPieceLength", "pieceLength")] ''PieceInfo |
diff --git a/src/Data/Torrent/Progress.hs b/src/Data/Torrent/Progress.hs index 1a4a68e2..34f8f299 100644 --- a/src/Data/Torrent/Progress.hs +++ b/src/Data/Torrent/Progress.hs | |||
@@ -62,7 +62,7 @@ data Progress = Progress | |||
62 | } deriving (Show, Read, Eq) | 62 | } deriving (Show, Read, Eq) |
63 | 63 | ||
64 | $(makeLenses ''Progress) | 64 | $(makeLenses ''Progress) |
65 | $(deriveJSON L.tail ''Progress) | 65 | $(deriveJSON defaultOptions { fieldLabelModifier = L.tail } ''Progress) |
66 | 66 | ||
67 | -- | UDP tracker compatible encoding. | 67 | -- | UDP tracker compatible encoding. |
68 | instance Serialize Progress where | 68 | instance Serialize Progress where |