diff options
author | Sam T <pxqr.sta@gmail.com> | 2013-05-12 07:31:58 +0400 |
---|---|---|
committer | Sam T <pxqr.sta@gmail.com> | 2013-05-12 07:31:58 +0400 |
commit | a2bc26abbe6ccea464c04b990f8a4a8fa769ba2a (patch) | |
tree | a378e98388e02393e435a20335c6d1515da311b0 /src/Remote/KRPC | |
parent | fafdbec2cb64f11513bfe3a0a220562de97d9e36 (diff) |
~ Move Method to KRPC.
Diffstat (limited to 'src/Remote/KRPC')
-rw-r--r-- | src/Remote/KRPC/Method.hs | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/src/Remote/KRPC/Method.hs b/src/Remote/KRPC/Method.hs deleted file mode 100644 index 4d91fe47..00000000 --- a/src/Remote/KRPC/Method.hs +++ /dev/null | |||
@@ -1,54 +0,0 @@ | |||
1 | -- | | ||
2 | -- Copyright : (c) Sam T. 2013 | ||
3 | -- License : MIT | ||
4 | -- Maintainer : pxqr.sta@gmail.com | ||
5 | -- Stability : experimental | ||
6 | -- Portability : portable | ||
7 | -- | ||
8 | {-# LANGUAGE OverloadedStrings #-} | ||
9 | {-# LANGUAGE FlexibleInstances, UndecidableInstances #-} | ||
10 | module Remote.KRPC.Method | ||
11 | ( Method(methodName, methodParams, methodVals) | ||
12 | |||
13 | -- * Construction | ||
14 | , method | ||
15 | |||
16 | -- * Predefined methods | ||
17 | , idM | ||
18 | ) where | ||
19 | |||
20 | import Remote.KRPC.Protocol | ||
21 | |||
22 | |||
23 | -- | The | ||
24 | -- | ||
25 | -- * argument: type of method parameter | ||
26 | -- | ||
27 | -- * remote: A monad used by server-side. | ||
28 | -- | ||
29 | -- * result: type of return value of the method. | ||
30 | -- | ||
31 | data Method param result = Method { | ||
32 | -- | Name used in query and | ||
33 | methodName :: MethodName | ||
34 | |||
35 | -- | Description of each parameter in /right to left/ order. | ||
36 | , methodParams :: [ParamName] | ||
37 | |||
38 | -- | Description of each return value in /right to left/ order. | ||
39 | , methodVals :: [ValName] | ||
40 | } | ||
41 | |||
42 | -- TODO ppMethod | ||
43 | |||
44 | -- | Remote identity function. Could be used for echo servers for example. | ||
45 | -- | ||
46 | -- idM = method "id" ["x"] ["y"] return | ||
47 | -- | ||
48 | idM :: Method a a | ||
49 | idM = method "id" ["x"] ["y"] | ||
50 | {-# INLINE idM #-} | ||
51 | |||
52 | method :: MethodName -> [ParamName] -> [ValName] -> Method param result | ||
53 | method = Method | ||
54 | {-# INLINE method #-} | ||