Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
This example will tie together a few different ideas. We’ll start with a chat subsite, which allows us to embed a chat widget on any page. We’ll use the HTML5 event source API to handle sending events from the server to the client.
-- @Chat.hs{-# LANGUAGE OverloadedStrings, TypeFamilies, QuasiQuotes,TemplateHaskell, FlexibleInstances, MultiParamTypeClasses,FlexibleContexts#-}-- | This module defines a subsite that allows you to insert a chat box on-- any page of your site. It uses eventsource for sending the messages from-- the server to the browser.moduleChatwhereimportYesodimportControl.Concurrent.Chan(Chan,dupChan,writeChan