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/Piece.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/Piece.hs')
-rw-r--r-- | src/Data/Torrent/Piece.hs | 4 |
1 files changed, 2 insertions, 2 deletions
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 |