on master help sign in
replace lift with liftIO for less dependency
fb39ea8Ting-Yen Lai
wai-websockets/Network/Wai/Handler/WebSockets.hs+4−4
@@ -5,7 +5,7 @@ module Network.Wai.Handler.WebSockets
5 ) where
5 ) where
6
6
7import Control.Monad (forever)
7import Control.Monad (forever)
8−import Control.Monad.Trans (lift)
8+import Control.Monad.IO.Class (liftIO)
9import Control.Concurrent (forkIO, threadDelay)
9import Control.Concurrent (forkIO, threadDelay)
10import Control.Exception (SomeException (..), handle)
10import Control.Exception (SomeException (..), handle)
11import Blaze.ByteString.Builder (Builder)
11import Blaze.ByteString.Builder (Builder)
@@ -50,9 +50,9 @@ runWebSockets :: WS.ConnectionOptions
50 -> Source (ResourceT IO) ByteString
50 -> Source (ResourceT IO) ByteString
51 -> Warp.Connection
51 -> Warp.Connection
52 -> ResourceT IO ()
52 -> ResourceT IO ()
53−runWebSockets opts req app source conn = do
53+runWebSockets opts req app _ conn = do
54
54
55− (is, os) <- lift $ connectionToStreams conn
55+ (is, os) <- liftIO $ connectionToStreams conn
56
56
57 let pc = WS.PendingConnection
57 let pc = WS.PendingConnection
58 { WS.pendingOptions = opts
58 { WS.pendingOptions = opts
@@ -62,7 +62,7 @@ runWebSockets opts req app source conn = do
62 , WS.pendingOut = os
62 , WS.pendingOut = os
63 }
63 }
64
64
65− lift $ app pc
65+ liftIO $ app pc
66
66
67--------------------------------------------------------------------------------
67--------------------------------------------------------------------------------
68-- | Start a ping thread in the background
68-- | Start a ping thread in the background