summaryrefslogtreecommitdiff
path: root/src/Network/KRPC
diff options
context:
space:
mode:
Diffstat (limited to 'src/Network/KRPC')
-rw-r--r--src/Network/KRPC/Method.hs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Network/KRPC/Method.hs b/src/Network/KRPC/Method.hs
index 54aa8ef0..f2461a1b 100644
--- a/src/Network/KRPC/Method.hs
+++ b/src/Network/KRPC/Method.hs
@@ -2,14 +2,17 @@
2{-# LANGUAGE MultiParamTypeClasses #-} 2{-# LANGUAGE MultiParamTypeClasses #-}
3{-# LANGUAGE FunctionalDependencies #-} 3{-# LANGUAGE FunctionalDependencies #-}
4{-# LANGUAGE GeneralizedNewtypeDeriving #-} 4{-# LANGUAGE GeneralizedNewtypeDeriving #-}
5{-# LANGUAGE ScopedTypeVariables #-} 5{-# LANGUAGE ScopedTypeVariables #-}
6{-# LANGUAGE DefaultSignatures #-}
6module Network.KRPC.Method 7module Network.KRPC.Method
7 ( Method (..) 8 ( Method (..)
8 , KRPC (..) 9 , KRPC (..)
9 ) where 10 ) where
10 11
11import Data.BEncode (BEncode) 12import Data.BEncode (BEncode)
13import Data.Char
12import Data.Monoid 14import Data.Monoid
15import Data.List as L
13import Data.String 16import Data.String
14import Data.Typeable 17import Data.Typeable
15import Network.KRPC.Message 18import Network.KRPC.Message
@@ -59,3 +62,8 @@ showsMethod (Method name) =
59-- @ 62-- @
60class (BEncode req, BEncode resp) => KRPC req resp | req -> resp where 63class (BEncode req, BEncode resp) => KRPC req resp | req -> resp where
61 method :: Method req resp 64 method :: Method req resp
65
66 default method :: Typeable req => Method req resp
67 method = Method $ fromString $ L.map toLower $ show $ typeOf hole
68 where
69 hole = error "krpc.method: impossible" :: req