title: Compile error when trying some Yesod examples
body: <p>I am trying <code>Yesod</code> book examples documented on Yesod webpage. One of the examples is for <a href="http://www.yesodweb.com/book/wiki-chat-example" rel="noreferrer">Chat application embedded in Wiki</a>. When I try it in ghci (loading <code>Chat</code> module from <code>Wiki.hs</code> which contains Wiki example code), I get the error below for Chat.hs:</p>
  
  <pre><code>Chat.hs:122:34:
      Could not deduce (Text.Julius.ToJavascript Text)
        arising from a use of `Text.Julius.toJavascript'
      from the context (YesodChat master)
        bound by the type signature for
                   chatWidget :: YesodChat master =&gt;
                                 (Route Chat -&gt; Route master) -&gt; GWidget sub master ()
        at Chat.hs:(81,15)-(83,35)
      Possible fix:
        add an instance declaration for (Text.Julius.ToJavascript Text)
      In the first argument of `Text.Julius.Javascript', namely
        `Text.Julius.toJavascript output'
      In the expression:
        Text.Julius.Javascript (Text.Julius.toJavascript output)
      In the first argument of `Data.Monoid.mconcat', namely
        `[Text.Julius.Javascript
            ((Data.Text.Lazy.Builder.fromText . Text.Shakespeare.pack')
               "\
               \// Set up the receiving end\
               \var output = document.getElementById(\""),
          Text.Julius.Javascript (Text.Julius.toJavascript output),
          Text.Julius.Javascript
            ((Data.Text.Lazy.Builder.fromText . Text.Shakespeare.pack')
               "\");\
               \var src = new EventSource(\""),
          Text.Julius.Javascript
            (Data.Text.Lazy.Builder.fromText
               (_render_a3Yr (toMaster ReceiveR) [])),
          ....]'
  </code></pre>
  
  <p>I am not very familiar with Yesod libraries yet. So, I am stumped by the above error - I have seen this error in other Yesod examples too where <code>toWidget</code> function is called. So, it seems to be related to <code>toWidget</code> function. I will appreciate help in fixing the above error.</p>
  
  <p>I am using <code>ghc 7.6.1</code> with <code>yesod 1.1.4.1</code>.</p>
  
  <p><strong>Update:</strong></p>
  
  <p>Fixed following Hammar's suggestion. I made two changes in <code>Chat.hs</code>.</p>
  
  <ol>
  <li><p>Add import statement for rawJS:</p>
  
  <p><code>import Text.Julius (rawJS)</code></p></li>
  <li><p>Track down all instances of #{} blocks within <code>julius whamlet</code> in <code>Chat.hs</code>, and replace them with <code>{# rawJS ...}</code></p>
  
  <p><code>var output = document.getElementById("#{rawJS output}");</code></p>
  
  <p><code>var input = document.getElementById("#{rawJS input}");</code></p></li>
  </ol>