<font size="4"><font face="times new roman,serif"><font size="4" style="font-family:arial;font-size:small"><font face="times new roman,serif">Hi </font></font><div style="font-family:arial;font-size:small">
<font size="4"><font face="times new roman,serif"><br></font></font></div><div style="font-family:arial;font-size:small"><font size="4"><font face="times new roman,serif">I tried <a href="http://www.yesodweb.com/five-minutes" target="_blank">yesod in five minutes</a> and I&#39;m having a problem trying to add a date and time string that would update on refresh. </font></font></div>


<div style="font-family:arial;font-size:small"><font size="4"><font face="times new roman,serif"><br></font></font></div><div style="font-family:arial;font-size:small"><font size="4"><font face="times new roman,serif">I just want to add it to the simple page you get with yesod in 5 minutes. I can embed a date and time string that is the value of a Haskell variable but that won&#39;t refresh on update to the current date and time. My simplistic approach was to put a line in Handler/root.hs:</font></font></div>



<div style="font-family:arial;font-size:small"><span style="font-family:&#39;times new roman&#39;, serif;font-size:large"><br></span></div></font></font><blockquote style="margin:0 0 0 40px;border:none;padding:0px">
<font size="4"><font face="times new roman,serif"><div style="font-family:arial;font-size:small"><span style="font-family:&#39;times new roman&#39;, serif;font-size:large">currTimeAndDate = getClockTime</span></div>
<div style="font-family:arial;font-size:small"><span style="font-family:&#39;times new roman&#39;, serif;font-size:large"><br></span></div></font></font></blockquote><font face="&#39;times new roman&#39;, serif" size="4">but that won&#39;t compile:</font><div>



<font face="&#39;times new roman&#39;, serif" size="4"><br></font></div><div><font face="&#39;times new roman&#39;, serif" size="4"><div><br></div></font></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px">



<div><font face="&#39;times new roman&#39;, serif" size="4"><div>Handler/Root.hs:22:21:</div></font></div><div><font face="&#39;times new roman&#39;, serif" size="4"><div>
    No instance for (blaze-html-0.4.1.1:Text.Blaze.ToHtml</div></font></div><div><font face="&#39;times new roman&#39;, serif" size="4"><div>                       (IO ClockTime))</div></font></div>
<div><font face="&#39;times new roman&#39;, serif" size="4"><div>      arising from a use of `toHtml&#39;</div></font></div><div><font face="&#39;times new roman&#39;, serif" size="4"><div>
    Possible fix:</div></font></div><div><font face="&#39;times new roman&#39;, serif" size="4"><div>      add an instance declaration for</div></font></div><div><font face="&#39;times new roman&#39;, serif" size="4"><div>



      (blaze-html-0.4.1.1:Text.Blaze.ToHtml (IO ClockTime))</div></font></div><div><font face="&#39;times new roman&#39;, serif" size="4"><div>    In the second argument of `(.)&#39;, namely `toHtml&#39;</div>
</font></div><div><font face="&#39;times new roman&#39;, serif" size="4"><div>    In the expression:</div></font></div><div><font face="&#39;times new roman&#39;, serif" size="4"><div>
        hamlet-0.8.2:Text.Hamlet.Quasi.htmlToHamletMonad . toHtml</div></font></div><div><font face="&#39;times new roman&#39;, serif" size="4"><div>    In a stmt of a &#39;do&#39; expression:</div>
</font></div><div><font face="&#39;times new roman&#39;, serif" size="4"><div>        (hamlet-0.8.2:Text.Hamlet.Quasi.htmlToHamletMonad . toHtml)</div></font></div><div><font face="&#39;times new roman&#39;, serif" size="4"><div>



          currTimeAndDate</div></font></div></blockquote><div><font size="4"><font face="times new roman,serif"><div><br></div><div>I&#39;m sure it would compile if I wrapped getClockTime with unsafePerformIO to get a String but then refresh of the page wouldn&#39;t give me  the current time. In addition it doesn&#39;t seem like the right way to do this. </div>


<div><br></div><div>I&#39;m sure my problem is due to my lack of knowledge of Haskell IO and monads which I do plan to learn thoroughly but right now I&#39;d just like to get this to work. It seems like  I could do it with a form in Yesod but that seems like overkill and wouldn&#39;t have the look I want.</div>

<div><br></div><div>I&#39;m very impressed with the software, the book and the source code for the <a href="http://www.haskellers.com">www.haskellers.com</a>. It is a testimony to the quality of all three that I have got this far, particularly considering how little I know. Any help would be greatly appreciated.</div>

<div><br></div><div>Sincerely</div><div>George</div><div><br></div>
<div style="font-family:arial;font-size:small">
<ol></ol></div></font></font>
</div>