diff options
-rw-r--r-- | TODO.org | 4 | ||||
-rw-r--r-- | src/Remote/KRPC.hs | 8 |
2 files changed, 9 insertions, 3 deletions
@@ -9,7 +9,7 @@ | |||
9 | * DONE add readme | 9 | * DONE add readme |
10 | * DONE return scheme back | 10 | * DONE return scheme back |
11 | * DONE add Show instance for Method | 11 | * DONE add Show instance for Method |
12 | * TODO add BEncodable instance for Method | 12 | * DONE add BEncodable instance for Method |
13 | * TODO hide async api | 13 | * TODO remove async api |
14 | * TODO expose client addr in server-side | 14 | * TODO expose client addr in server-side |
15 | * TODO major version bump (reason: exported type changed) | 15 | * TODO major version bump (reason: exported type changed) |
diff --git a/src/Remote/KRPC.hs b/src/Remote/KRPC.hs index 71faa3f3..88882da2 100644 --- a/src/Remote/KRPC.hs +++ b/src/Remote/KRPC.hs | |||
@@ -91,6 +91,7 @@ | |||
91 | {-# LANGUAGE ExplicitForAll #-} | 91 | {-# LANGUAGE ExplicitForAll #-} |
92 | {-# LANGUAGE KindSignatures #-} | 92 | {-# LANGUAGE KindSignatures #-} |
93 | {-# LANGUAGE ScopedTypeVariables #-} | 93 | {-# LANGUAGE ScopedTypeVariables #-} |
94 | {-# LANGUAGE DeriveGeneric #-} | ||
94 | module Remote.KRPC | 95 | module Remote.KRPC |
95 | ( -- * Method | 96 | ( -- * Method |
96 | Method(..) | 97 | Method(..) |
@@ -121,8 +122,11 @@ import Data.Monoid | |||
121 | import Data.Typeable | 122 | import Data.Typeable |
122 | import Network | 123 | import Network |
123 | 124 | ||
125 | import GHC.Generics | ||
126 | |||
124 | import Remote.KRPC.Protocol | 127 | import Remote.KRPC.Protocol |
125 | 128 | ||
129 | |||
126 | -- | Method datatype used to describe name, parameters and return | 130 | -- | Method datatype used to describe name, parameters and return |
127 | -- values of procedure. Client use a method to /invoke/, server | 131 | -- values of procedure. Client use a method to /invoke/, server |
128 | -- /implements/ the method to make the actual work. | 132 | -- /implements/ the method to make the actual work. |
@@ -154,7 +158,9 @@ data Method param result = Method { | |||
154 | 158 | ||
155 | -- | Name of each return value in /right to left/ order. | 159 | -- | Name of each return value in /right to left/ order. |
156 | , methodVals :: [ValName] | 160 | , methodVals :: [ValName] |
157 | } | 161 | } deriving (Eq, Ord, Generic) |
162 | |||
163 | instance BEncodable (Method a b) | ||
158 | 164 | ||
159 | instance (Typeable a, Typeable b) => Show (Method a b) where | 165 | instance (Typeable a, Typeable b) => Show (Method a b) where |
160 | showsPrec _ = showsMethod | 166 | showsPrec _ = showsMethod |