summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO.org4
-rw-r--r--src/Remote/KRPC.hs8
2 files changed, 9 insertions, 3 deletions
diff --git a/TODO.org b/TODO.org
index ddd2a846..7a8ac308 100644
--- a/TODO.org
+++ b/TODO.org
@@ -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 #-}
94module Remote.KRPC 95module Remote.KRPC
95 ( -- * Method 96 ( -- * Method
96 Method(..) 97 Method(..)
@@ -121,8 +122,11 @@ import Data.Monoid
121import Data.Typeable 122import Data.Typeable
122import Network 123import Network
123 124
125import GHC.Generics
126
124import Remote.KRPC.Protocol 127import 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
163instance BEncodable (Method a b)
158 164
159instance (Typeable a, Typeable b) => Show (Method a b) where 165instance (Typeable a, Typeable b) => Show (Method a b) where
160 showsPrec _ = showsMethod 166 showsPrec _ = showsMethod