diff options
Diffstat (limited to 'src/Network/KRPC/Method.hs')
-rw-r--r-- | src/Network/KRPC/Method.hs | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/Network/KRPC/Method.hs b/src/Network/KRPC/Method.hs index 2a791924..ad93cb8b 100644 --- a/src/Network/KRPC/Method.hs +++ b/src/Network/KRPC/Method.hs | |||
@@ -8,11 +8,13 @@ | |||
8 | -- Normally, you don't need to import this module. | 8 | -- Normally, you don't need to import this module. |
9 | -- | 9 | -- |
10 | {-# LANGUAGE CPP #-} | 10 | {-# LANGUAGE CPP #-} |
11 | {-# LANGUAGE RankNTypes #-} | 11 | {-# LANGUAGE DefaultSignatures #-} |
12 | {-# LANGUAGE MultiParamTypeClasses #-} | ||
13 | {-# LANGUAGE GeneralizedNewtypeDeriving #-} | 12 | {-# LANGUAGE GeneralizedNewtypeDeriving #-} |
13 | {-# LANGUAGE MultiParamTypeClasses #-} | ||
14 | {-# LANGUAGE RankNTypes #-} | ||
14 | {-# LANGUAGE ScopedTypeVariables #-} | 15 | {-# LANGUAGE ScopedTypeVariables #-} |
15 | {-# LANGUAGE DefaultSignatures #-} | 16 | {-# LANGUAGE TypeFamilies #-} |
17 | {-# LANGUAGE FunctionalDependencies #-} | ||
16 | module Network.KRPC.Method | 18 | module Network.KRPC.Method |
17 | ( Method (..) | 19 | ( Method (..) |
18 | , KRPC (..) | 20 | , KRPC (..) |
@@ -93,7 +95,9 @@ class ( Typeable req, Typeable resp | |||
93 | , Serialize req, Serialize resp | 95 | , Serialize req, Serialize resp |
94 | #endif | 96 | #endif |
95 | ) | 97 | ) |
96 | => KRPC req resp where | 98 | => KRPC req resp | req -> resp, resp -> req where |
99 | |||
100 | type Envelope req resp | ||
97 | 101 | ||
98 | -- | Method name. Default implementation uses lowercased @req@ | 102 | -- | Method name. Default implementation uses lowercased @req@ |
99 | -- datatype name. | 103 | -- datatype name. |
@@ -107,3 +111,6 @@ class ( Typeable req, Typeable resp | |||
107 | where | 111 | where |
108 | hole = error "krpc.method: impossible" :: req | 112 | hole = error "krpc.method: impossible" :: req |
109 | #endif | 113 | #endif |
114 | |||
115 | unseal :: Envelope req resp -> Either String req | ||
116 | seal :: resp -> Envelope req resp | ||