Eliminate deprecation warnings when building websockets sample.hs
This commit is contained in:
parent
c5268e3581
commit
e1a33248b0
@ -16,7 +16,7 @@ mkYesod "App" [parseRoutes|
|
|||||||
/ HomeR GET
|
/ HomeR GET
|
||||||
|]
|
|]
|
||||||
|
|
||||||
timeSource :: MonadIO m => Source m TL.Text
|
timeSource :: MonadIO m => ConduitT () TL.Text m ()
|
||||||
timeSource = forever $ do
|
timeSource = forever $ do
|
||||||
now <- liftIO getCurrentTime
|
now <- liftIO getCurrentTime
|
||||||
yield $ TL.pack $ show now
|
yield $ TL.pack $ show now
|
||||||
@ -25,8 +25,8 @@ timeSource = forever $ do
|
|||||||
getHomeR :: Handler Html
|
getHomeR :: Handler Html
|
||||||
getHomeR = do
|
getHomeR = do
|
||||||
webSockets $ race_
|
webSockets $ race_
|
||||||
(sourceWS $$ Data.Conduit.List.map TL.toUpper =$ sinkWSText)
|
(runConduit (sourceWS .| Data.Conduit.List.map TL.toUpper .| sinkWSText))
|
||||||
(timeSource $$ sinkWSText)
|
(runConduit (timeSource .| sinkWSText))
|
||||||
defaultLayout $
|
defaultLayout $
|
||||||
toWidget
|
toWidget
|
||||||
[julius|
|
[julius|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user