@@ -8,6 +8,8 @@ this example, keep the [reference](http://jaspervdj.be/websockets/reference)
88nearby to check out the functions we use.
99
1010> {-# LANGUAGE OverloadedStrings, TemplateHaskell #-}
11+> {-# LANGUAGE CPP #-}
12+> {-# OPTIONS_GHC -Wno-unused-top-binds #-} -- for numClients
1113> import Data.Char (isPunctuation, isSpace)
1214> import Data.Monoid (mappend)
1315> import Data.Text (Text)
@@ -99,7 +101,11 @@ stays alive on some browsers.
99101
100102> application state pending = do
101103> conn <- WS.acceptRequest pending
104+#if __GLASGOW_HASKELL__ >= 806
102105> WS.withPingThread conn 30 (return ()) $ do
106+#else
107+> WS.forkPingThread conn 30
108+#endif
103109
104110When a client is successfully connected, we read the first message. This should
105111be in the format of "Hi! I am Jasper", where Jasper is the requested username.