Merge pull request #1568 from stevehartdata/master

Eliminate deprecation warnings when building websockets sample.hs
This commit is contained in:
Michael Snoyman 2019-01-09 08:49:51 +02:00 committed by GitHub
commit 72c6187a22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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|