diff --git a/yesod-examples/src/chat.hs b/yesod-examples/src/chat.hs index b02a47fc..d0551238 100644 --- a/yesod-examples/src/chat.hs +++ b/yesod-examples/src/chat.hs @@ -6,7 +6,7 @@ module Main where import Yesod -import Yesod.Helpers.Static +import Yesod.Static import Control.Concurrent.STM import Control.Concurrent.STM.TChan @@ -18,8 +18,6 @@ import Data.Text (Text, unpack) -- speaker and content data Message = Message Text Text -type Handler yesod = GHandler yesod yesod - -- all those TChans are dupes, so writing to any one writes to them all, but reading is separate data Chat = Chat { chatClients :: TVar [(Int, TChan Message)] @@ -54,7 +52,7 @@ instance Yesod Chat where \ |] -getHomeR :: Handler Chat RepHtml +getHomeR :: Handler RepHtml getHomeR = do Chat clients next _ <- getYesod client <- liftIO . atomically $ do @@ -68,7 +66,7 @@ getHomeR = do return c defaultLayout $ do setTitle "Chat Page" - addWidget [$hamlet|\ + toWidget [$hamlet|\ \