diff options
author | Sam T <pxqr.sta@gmail.com> | 2013-05-12 06:46:58 +0400 |
---|---|---|
committer | Sam T <pxqr.sta@gmail.com> | 2013-05-12 06:46:58 +0400 |
commit | 5ee611585e4eb6acb89b34e6679d89e25098e23b (patch) | |
tree | 2ce638efe2782efc1559d82e859abf1129d34aad /examples/Shared.hs | |
parent | ee8c82ed5ba8be43d858fa28020cc249d21795f6 (diff) |
- Remove Extractable class, fix multi param methods.
Diffstat (limited to 'examples/Shared.hs')
-rw-r--r-- | examples/Shared.hs | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/examples/Shared.hs b/examples/Shared.hs index 49cef490..2d5b9cbb 100644 --- a/examples/Shared.hs +++ b/examples/Shared.hs | |||
@@ -1,14 +1,27 @@ | |||
1 | {-# LANGUAGE OverloadedStrings #-} | 1 | {-# LANGUAGE OverloadedStrings #-} |
2 | module Shared (echoInt, swapM) where | 2 | module Shared |
3 | (echoM, unitM, swapM, reverseM, shiftR | ||
4 | ) where | ||
3 | 5 | ||
4 | import Remote.KRPC | 6 | import Remote.KRPC |
5 | 7 | ||
6 | echoInt :: Method Int Int | 8 | unitM :: Method () () |
7 | echoInt = idM | 9 | unitM = method "unit" [] [] |
10 | |||
11 | echoM :: Method Int Int | ||
12 | echoM = method "echo" ["x"] ["x"] | ||
13 | |||
14 | reverseM :: Method [Int] [Int] | ||
15 | reverseM = method "reverse" ["xs"] ["ys"] | ||
8 | 16 | ||
9 | swapM :: Method (Int, Int) (Int, Int) | 17 | swapM :: Method (Int, Int) (Int, Int) |
10 | swapM = method "swap" ["x", "y"] ["b", "a"] | 18 | swapM = method "swap" ["x", "y"] ["b", "a"] |
11 | 19 | ||
20 | shiftR :: Method ((), Int, [Int]) ([Int], (), Int) | ||
21 | shiftR = method "shiftR" ["x", "y", "z"] ["a", "b", "c"] | ||
22 | |||
23 | |||
24 | |||
12 | {- | 25 | {- |
13 | type NodeId = Int | 26 | type NodeId = Int |
14 | type InfoHashe = Int | 27 | type InfoHashe = Int |