diff options
Diffstat (limited to 'src/Data/Torrent')
-rw-r--r-- | src/Data/Torrent/Block.hs | 2 | ||||
-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 |
4 files changed, 6 insertions, 6 deletions
diff --git a/src/Data/Torrent/Block.hs b/src/Data/Torrent/Block.hs index 37889a7a..fd12b7a0 100644 --- a/src/Data/Torrent/Block.hs +++ b/src/Data/Torrent/Block.hs | |||
@@ -97,7 +97,7 @@ data BlockIx = BlockIx { | |||
97 | , ixLength :: {-# UNPACK #-} !BlockSize | 97 | , ixLength :: {-# UNPACK #-} !BlockSize |
98 | } deriving (Show, Eq) | 98 | } deriving (Show, Eq) |
99 | 99 | ||
100 | $(deriveJSON (L.map toLower . L.dropWhile isLower) ''BlockIx) | 100 | $(deriveJSON defaultOptions { fieldLabelModifier = (L.map toLower . L.dropWhile isLower) } ''BlockIx) |
101 | 101 | ||
102 | getInt :: S.Get Int | 102 | getInt :: S.Get Int |
103 | getInt = fromIntegral <$> S.getWord32be | 103 | getInt = fromIntegral <$> S.getWord32be |
diff --git a/src/Data/Torrent/Layout.hs b/src/Data/Torrent/Layout.hs index 8f35772d..d39c6c04 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 7eb4e3d5..f7c6257b 100644 --- a/src/Data/Torrent/Piece.hs +++ b/src/Data/Torrent/Piece.hs | |||
@@ -117,7 +117,7 @@ data Piece a = Piece | |||
117 | , pieceData :: !a | 117 | , pieceData :: !a |
118 | } deriving (Show, Read, Eq, Typeable) | 118 | } deriving (Show, Read, Eq, Typeable) |
119 | 119 | ||
120 | $(deriveJSON (L.map toLower . L.dropWhile isLower) ''Piece) | 120 | $(deriveJSON defaultOptions { fieldLabelModifier = (L.map toLower . L.dropWhile isLower) } ''Piece) |
121 | 121 | ||
122 | instance NFData (Piece a) | 122 | instance NFData (Piece a) |
123 | 123 | ||
@@ -160,7 +160,7 @@ data PieceInfo = PieceInfo | |||
160 | -- ^ Concatenation of all 20-byte SHA1 hash values. | 160 | -- ^ Concatenation of all 20-byte SHA1 hash values. |
161 | } deriving (Show, Read, Eq, Typeable) | 161 | } deriving (Show, Read, Eq, Typeable) |
162 | 162 | ||
163 | $(deriveJSON (L.map toLower . L.dropWhile isLower) ''PieceInfo) | 163 | $(deriveJSON defaultOptions { fieldLabelModifier = (L.map toLower . L.dropWhile isLower) } ''PieceInfo) |
164 | 164 | ||
165 | -- | Number of bytes in each piece. | 165 | -- | Number of bytes in each piece. |
166 | makeLensesFor [("piPieceLength", "pieceLength")] ''PieceInfo | 166 | 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 |