1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
{-# LANGUAGE OverloadedStrings #-}
module Shared
( echoM
, echoBytes
, unitM
, swapM
, reverseM
, shiftR
, rawM
) where
import Data.ByteString (ByteString)
import Data.BEncode
import Remote.KRPC
unitM :: Method () ()
unitM = method "unit" [] []
echoM :: Method Int Int
echoM = method "echo" ["x"] ["x"]
echoBytes :: Method ByteString ByteString
echoBytes = method "echoBytes" ["x"] ["x"]
reverseM :: Method [Int] [Int]
reverseM = method "reverse" ["xs"] ["ys"]
swapM :: Method (Int, Int) (Int, Int)
swapM = method "swap" ["x", "y"] ["b", "a"]
shiftR :: Method ((), Int, [Int]) ([Int], (), Int)
shiftR = method "shiftR" ["x", "y", "z"] ["a", "b", "c"]
rawM :: Method BEncode BEncode
rawM = method "rawM" [""] [""]
|