From b83c5d53be21c03004ebb65d1dc9fe1f841a2a3c Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Sun, 1 Dec 2013 21:12:40 +0100 Subject: 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. --- src/Network/BitTorrent/Tracker/RPC/Message.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Network/BitTorrent/Tracker/RPC/Message.hs') diff --git a/src/Network/BitTorrent/Tracker/RPC/Message.hs b/src/Network/BitTorrent/Tracker/RPC/Message.hs index cec68169..213f1e83 100644 --- a/src/Network/BitTorrent/Tracker/RPC/Message.hs +++ b/src/Network/BitTorrent/Tracker/RPC/Message.hs @@ -93,7 +93,7 @@ data Event = Started -- ^ To be sent when the peer completes a download. deriving (Show, Read, Eq, Ord, Enum, Bounded, Typeable) -$(deriveJSON (L.map toLower . L.dropWhile isLower) ''Event) +$(deriveJSON defaultOptions { fieldLabelModifier = (L.map toLower . L.dropWhile isLower) } ''Event) -- | HTTP tracker protocol compatible encoding. instance QueryValueLike Event where @@ -163,7 +163,7 @@ data AnnounceQuery = AnnounceQuery , reqEvent :: Maybe Event } deriving (Show, Eq, Typeable) -$(deriveJSON (L.map toLower . L.dropWhile isLower) ''AnnounceQuery) +$(deriveJSON defaultOptions { fieldLabelModifier = (L.map toLower . L.dropWhile isLower) } ''AnnounceQuery) -- | UDP tracker protocol compatible encoding. instance Serialize AnnounceQuery where @@ -386,7 +386,7 @@ data AnnounceInfo = , respWarning :: !(Maybe Text) } deriving (Show, Typeable) -$(deriveJSON (L.map toLower . L.dropWhile isLower) ''AnnounceInfo) +$(deriveJSON defaultOptions { fieldLabelModifier = (L.map toLower . L.dropWhile isLower) } ''AnnounceInfo) -- | HTTP tracker protocol compatible encoding. instance BEncode AnnounceInfo where @@ -524,7 +524,7 @@ data ScrapeEntry = ScrapeEntry { , siName :: !(Maybe Text) } deriving (Show, Eq, Typeable) -$(deriveJSON (L.map toLower . L.dropWhile isLower) ''ScrapeEntry) +$(deriveJSON defaultOptions { fieldLabelModifier = (L.map toLower . L.dropWhile isLower) } ''ScrapeEntry) -- | HTTP tracker protocol compatible encoding. instance BEncode ScrapeEntry where -- cgit v1.2.3