THRIFT-743: seems to compile and doesn't break other tests, so seems fine for now
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1001353 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/hs/src/Thrift.hs b/lib/hs/src/Thrift.hs
index 71957c4..9b4d41e 100644
--- a/lib/hs/src/Thrift.hs
+++ b/lib/hs/src/Thrift.hs
@@ -90,27 +90,27 @@
readAppExn :: (Protocol p, Transport t) => p t -> IO AppExn
readAppExn pt = do
_ <- readStructBegin pt
- rec <- readAppExnFields pt (AppExn {ae_type = undefined, ae_message = undefined})
+ record <- readAppExnFields pt (AppExn {ae_type = undefined, ae_message = undefined})
readStructEnd pt
- return rec
+ return record
readAppExnFields :: forall (a :: * -> *) t. (Protocol a, Transport t) => a t -> AppExn -> IO AppExn
-readAppExnFields pt rec = do
+readAppExnFields pt record = do
(_, ft, tag) <- readFieldBegin pt
if ft == T_STOP
- then return rec
+ then return record
else case tag of
1 -> if ft == T_STRING then
do s <- readString pt
- readAppExnFields pt rec{ae_message = s}
+ readAppExnFields pt record{ae_message = s}
else do skip pt ft
- readAppExnFields pt rec
+ readAppExnFields pt record
2 -> if ft == T_I32 then
do i <- readI32 pt
- readAppExnFields pt rec{ae_type = (toEnum $ fromIntegral i)}
+ readAppExnFields pt record{ae_type = (toEnum $ fromIntegral i)}
else do skip pt ft
- readAppExnFields pt rec
+ readAppExnFields pt record
_ -> do skip pt ft
readFieldEnd pt
- readAppExnFields pt rec
+ readAppExnFields pt record
diff --git a/lib/hs/src/Thrift/Server.hs b/lib/hs/src/Thrift/Server.hs
index 4634a6b..ed74ceb 100644
--- a/lib/hs/src/Thrift/Server.hs
+++ b/lib/hs/src/Thrift/Server.hs
@@ -44,23 +44,23 @@
-> (h -> (i t, o t) -> IO Bool)
-> PortID
-> IO a
-runThreadedServer accepter hand proc port = do
+runThreadedServer accepter hand proc_ port = do
socket <- listenOn port
- acceptLoop (accepter socket) (proc hand)
+ acceptLoop (accepter socket) (proc_ hand)
-- | A basic threaded binary protocol socket server.
runBasicServer :: h
-> (h -> (BinaryProtocol Handle, BinaryProtocol Handle) -> IO Bool)
-> PortNumber
-> IO a
-runBasicServer hand proc port = runThreadedServer binaryAccept hand proc (PortNumber port)
+runBasicServer hand proc_ port = runThreadedServer binaryAccept hand proc_ (PortNumber port)
where binaryAccept s = do
(h, _, _) <- accept s
return (BinaryProtocol h, BinaryProtocol h)
acceptLoop :: IO t -> (t -> IO Bool) -> IO a
-acceptLoop accepter proc = forever $
+acceptLoop accepter proc_ = forever $
do ps <- accepter
forkIO $ handle (\(_ :: SomeException) -> return ())
- (loop $ proc ps)
+ (loop $ proc_ ps)
where loop m = do { continue <- m; when continue (loop m) }