diff options
author | Sam Truzjan <pxqr.sta@gmail.com> | 2013-12-31 18:23:23 +0400 |
---|---|---|
committer | Sam Truzjan <pxqr.sta@gmail.com> | 2013-12-31 18:23:23 +0400 |
commit | ab80dc87b0d0440a8566e389f4f5f2d95d931a1a (patch) | |
tree | 10bd8c608bc790fbafcfb1270e8a00b805688557 /src | |
parent | d52c84101661de38bd984de96d84e5a61f2ad9da (diff) |
Add default instance for NodeAddr
Diffstat (limited to 'src')
-rw-r--r-- | src/Network/BitTorrent/Core/Node.hs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Network/BitTorrent/Core/Node.hs b/src/Network/BitTorrent/Core/Node.hs index 03f01ed0..da96ca43 100644 --- a/src/Network/BitTorrent/Core/Node.hs +++ b/src/Network/BitTorrent/Core/Node.hs | |||
@@ -122,6 +122,10 @@ data NodeAddr a = NodeAddr | |||
122 | 122 | ||
123 | $(deriveJSON omitRecordPrefix ''NodeAddr) | 123 | $(deriveJSON omitRecordPrefix ''NodeAddr) |
124 | 124 | ||
125 | -- | @127.0.0.1:6882@ | ||
126 | instance Default (NodeAddr IPv4) where | ||
127 | def = "127.0.0.1:6882" | ||
128 | |||
125 | -- | KRPC compatible encoding. | 129 | -- | KRPC compatible encoding. |
126 | instance Serialize a => Serialize (NodeAddr a) where | 130 | instance Serialize a => Serialize (NodeAddr a) where |
127 | get = NodeAddr <$> get <*> get | 131 | get = NodeAddr <$> get <*> get |