Hello everyone. I have a quick question about Time. <br><br>I was talking about Haskell on the Arch Linux forums today, and someone was trying to put together code that would print a series of periods for, say, 5 minutes. I felt like using &#39;until&#39; would be the most correct way of going about it, but when I tried to do it...<br>

<br><br>import Time<br><br>makeLater&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :: ClockTime -&gt; ClockTime<br>makeLater t&nbsp;&nbsp;&nbsp; =&nbsp; addToClockTime (TimeDiff 0 0 0 0 0 5 0) t<br><br>updateTime :: ClockTime -&gt; ClockTime<br>updateTime t = t<br><br>main = do<br>

&nbsp; start &lt;- getClockTime<br>&nbsp; until ((==) $ makeLater start) (updateTime) start<br>&nbsp; putStrLn &quot;done&quot;<br><br>Now, updateTime isn&#39;t correct. And this wouldn&#39;t print any periods. But GHC is giving me errors:<br>

<br>$ runhaskell temp.hs<br><br>temp.hs:11:2:<br>&nbsp;&nbsp;&nbsp; Couldn&#39;t match expected type `IO t&#39;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; against inferred type `ClockTime&#39;<br>&nbsp;&nbsp;&nbsp; In the expression:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; until ((==) $ makeLater start) (updateTime) start<br>

&nbsp;&nbsp;&nbsp; In a &#39;do&#39; expression:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; until ((==) $ makeLater start) (updateTime) start<br>&nbsp;&nbsp;&nbsp; In the expression:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; do start &lt;- getClockTime<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; until ((==) $ makeLater start) (updateTime) start<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; putStrLn &quot;done&quot;<br><br>I&#39;m not sure where IO t is coming from at all. Am I even on the right track? How would you write this code?<br>