From e636c11c0369531f32095fa0459c26b0b07aebf5 Mon Sep 17 00:00:00 2001 From: Greg Weber Date: Sun, 6 Nov 2011 20:14:50 -0800 Subject: [PATCH] get all examples compiling --- yesod-examples/src/chat.hs | 15 +++++++-------- yesod-examples/src/i18n.lhs | 13 +++++++++++-- yesod-examples/synopsis/hamlet.lhs | 17 ++++++++++------- yesod-examples/yesod-examples.cabal | 6 +++++- 4 files changed, 33 insertions(+), 18 deletions(-) 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|\ \

Chat Example @@ -81,7 +79,7 @@ getHomeR = do