diff options
author | Sam Truzjan <pxqr.sta@gmail.com> | 2013-10-17 10:05:11 +0400 |
---|---|---|
committer | Sam Truzjan <pxqr.sta@gmail.com> | 2013-10-17 10:05:11 +0400 |
commit | 3c9a4b8ab83e201c58e56b070b2d6279cc84d139 (patch) | |
tree | 5bedc3e1fe91f164daffc3679c97aa622dc3d373 /src/Network/KRPC | |
parent | ee677c16e0e097c4ac2785de031f439e38dbf778 (diff) |
Strictify intermediate datatypes
Diffstat (limited to 'src/Network/KRPC')
-rw-r--r-- | src/Network/KRPC/Protocol.hs | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/Network/KRPC/Protocol.hs b/src/Network/KRPC/Protocol.hs index 7442d990..16027362 100644 --- a/src/Network/KRPC/Protocol.hs +++ b/src/Network/KRPC/Protocol.hs | |||
@@ -44,12 +44,6 @@ module Network.KRPC.Protocol | |||
44 | , KRemoteAddr | 44 | , KRemoteAddr |
45 | , withRemote | 45 | , withRemote |
46 | , remoteServer | 46 | , remoteServer |
47 | |||
48 | -- * Re-exports | ||
49 | , encode | ||
50 | , decode | ||
51 | , toBEncode | ||
52 | , fromBEncode | ||
53 | ) where | 47 | ) where |
54 | 48 | ||
55 | import Control.Applicative | 49 | import Control.Applicative |
@@ -80,16 +74,16 @@ import Network.Socket.ByteString | |||
80 | -- | 74 | -- |
81 | data KError | 75 | data KError |
82 | -- | Some error doesn't fit in any other category. | 76 | -- | Some error doesn't fit in any other category. |
83 | = GenericError { errorMessage :: ByteString } | 77 | = GenericError { errorMessage :: !ByteString } |
84 | 78 | ||
85 | -- | Occur when server fail to process procedure call. | 79 | -- | Occur when server fail to process procedure call. |
86 | | ServerError { errorMessage :: ByteString } | 80 | | ServerError { errorMessage :: !ByteString } |
87 | 81 | ||
88 | -- | Malformed packet, invalid arguments or bad token. | 82 | -- | Malformed packet, invalid arguments or bad token. |
89 | | ProtocolError { errorMessage :: ByteString } | 83 | | ProtocolError { errorMessage :: !ByteString } |
90 | 84 | ||
91 | -- | Occur when client trying to call method server don't know. | 85 | -- | Occur when client trying to call method server don't know. |
92 | | MethodUnknown { errorMessage :: ByteString } | 86 | | MethodUnknown { errorMessage :: !ByteString } |
93 | deriving (Show, Read, Eq, Ord, Typeable) | 87 | deriving (Show, Read, Eq, Ord, Typeable) |
94 | 88 | ||
95 | instance BEncode KError where | 89 | instance BEncode KError where |
@@ -141,7 +135,7 @@ type ParamName = ByteString | |||
141 | -- > { "y" : "q", "q" : "<method_name>", "a" : [<arg1>, <arg2>, ...] } | 135 | -- > { "y" : "q", "q" : "<method_name>", "a" : [<arg1>, <arg2>, ...] } |
142 | -- | 136 | -- |
143 | data KQuery = KQuery { | 137 | data KQuery = KQuery { |
144 | queryMethod :: MethodName | 138 | queryMethod :: !MethodName |
145 | , queryArgs :: BDict | 139 | , queryArgs :: BDict |
146 | } deriving (Show, Read, Eq, Ord, Typeable) | 140 | } deriving (Show, Read, Eq, Ord, Typeable) |
147 | 141 | ||