From 74d06faeb4dee931eea575f19481019f11179bde Mon Sep 17 00:00:00 2001 From: Sam Truzjan Date: Sun, 16 Feb 2014 19:40:55 +0400 Subject: Add functor instance for NodeInfo --- src/Network/BitTorrent/Core/NodeInfo.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/Network/BitTorrent/Core/NodeInfo.hs') diff --git a/src/Network/BitTorrent/Core/NodeInfo.hs b/src/Network/BitTorrent/Core/NodeInfo.hs index 2fd7e575..fa20caf5 100644 --- a/src/Network/BitTorrent/Core/NodeInfo.hs +++ b/src/Network/BitTorrent/Core/NodeInfo.hs @@ -19,6 +19,7 @@ {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE DeriveFunctor #-} module Network.BitTorrent.Core.NodeInfo ( -- * Node ID NodeId @@ -143,7 +144,7 @@ distance (NodeId a) (NodeId b) = NodeDistance (BS.pack (BS.zipWith xor a b)) data NodeAddr a = NodeAddr { nodeHost :: !a , nodePort :: {-# UNPACK #-} !PortNumber - } deriving (Eq, Typeable) + } deriving (Eq, Typeable, Functor) $(deriveJSON omitRecordPrefix ''NodeAddr) @@ -199,7 +200,7 @@ fromPeerAddr PeerAddr {..} = NodeAddr data NodeInfo a = NodeInfo { nodeId :: !NodeId , nodeAddr :: !(NodeAddr a) - } deriving (Show, Eq) + } deriving (Show, Eq, Functor) $(deriveJSON omitRecordPrefix ''NodeInfo) -- cgit v1.2.3