summaryrefslogtreecommitdiff
path: root/src/Network
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2017-08-11 01:08:30 -0400
committerjoe <joe@jerkface.net>2017-08-11 01:08:30 -0400
commitcd5091c4a3ab1c05b48ff3ad2fea666d77b8e39c (patch)
tree45bd1073d40830e6311bbaf8021899fec236abbc /src/Network
parent85a004ac92cac382a8c2824ca6b584764ab7782d (diff)
Reply to Announce with AnnounceResponse.
Diffstat (limited to 'src/Network')
-rw-r--r--src/Network/QueryResponse.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Network/QueryResponse.hs b/src/Network/QueryResponse.hs
index 190cc73e..11fe7c32 100644
--- a/src/Network/QueryResponse.hs
+++ b/src/Network/QueryResponse.hs
@@ -181,6 +181,16 @@ data MethodHandler err tid addr x = forall a b. MethodHandler
181 , noreplyAction :: addr -> a -> IO () 181 , noreplyAction :: addr -> a -> IO ()
182 } 182 }
183 183
184contramapAddr :: (a -> b) -> MethodHandler err tid b x -> MethodHandler err tid a x
185contramapAddr f (MethodHandler p s a)
186 = MethodHandler
187 p
188 (\tid src dst result -> s tid (f src) (f dst) result)
189 (\addr arg -> a (f addr) arg)
190contramapAddr f (NoReply p a)
191 = NoReply p (\addr arg -> a (f addr) arg)
192
193
184-- | Attempt to invoke a 'MethodHandler' upon a given inbound query. If the 194-- | Attempt to invoke a 'MethodHandler' upon a given inbound query. If the
185-- parse is successful, the returned IO action will construct our reply if 195-- parse is successful, the returned IO action will construct our reply if
186-- there is one. Otherwise, a parse err is returned. 196-- there is one. Otherwise, a parse err is returned.