I was trying to google "haskell process sleep" without much success. It really needs some experience to construct hoogle queries correctly :)<br>Thanks everybody for your help!<br><br><div class="gmail_quote">On Tue, Dec 6, 2011 at 8:07 PM, Paul R <span dir="ltr"><<a href="mailto:paul.r.ml@gmail.com">paul.r.ml@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">dokondr> Hi, I need to make the current process (executing thread) go to<br>
dokondr> sleep for a given amount of time. Can't find where threadSleep<br>
dokondr> is defined.<br>
<br>
Maybe because there is no such threadSleep function in base packages,<br>
what do you think ?<br>
<br>
Ok, let's see if we can find what you are looking for ... You want<br>
a function that will pause your thread for an amout of time then pass.<br>
In other word, it would take an Int and do nothing else than wait as<br>
a side effect, right ? Something typed "Int -> IO ()" should do that,<br>
right ?<br>
<br>
<a href="http://www.haskell.org/hoogle/?hoogle=Int+-%3E+IO+%28%29" target="_blank">http://www.haskell.org/hoogle/?hoogle=Int+-%3E+IO+%28%29</a><br>
<br>
=> threadDelay :: Int -> IO ()<br>
Suspends the current thread for a given number of microseconds ...<br>
<br>
And if you don't want to use the amazing power of hoogle, maybe you can<br>
simply go to your favorite search engine and type "haskell pause thread"<br>
in it. In mine, the first result is the doc of the Control.Concurrent<br>
module that has a "Waiting" section (linked in the toc) that has ...<br>
3 functions, amongst wich "threadDelay :: Int -> IO ()".<br>
<br>
Wasn't hard, was it ?<br>
<font color="#888888"><br>
--<br>
Paul<br>
</font></blockquote></div><br><br clear="all"><br>