i've just ran across a what-i-think-should-be-trivial-but-still-have-no-idea-how-to-do-it problem. i was going to write a config file for the dzen taskbar in haskell. the main loop should be run in certain intervals (see here), and i can't find any information about how i could do it in haskell. i couldn't find any wait or sleep or anything that sounded reasonable.
Take a look into Control.Concurrent or GHC.Conc in the Haskell documentation. There's four functions under the subtitle "Waiting" in both of them. The functions you want are the ones named "delay"; "wait" is reserved for blocking the thread untill a condition occurs (such as a resource becomming available)
threadDelay :: Int -> IO ()
Suspends the current thread for a given number of microseconds
There is no guarantee that the thread will be rescheduled promptly when the delay has expired, but the thread will never continue to run earlier than specified.
registerDelay :: Int -> IO (TVar Bool)
Set the value of returned TVar to True after a given number of microseconds. The caveats associated with threadDelay also apply.
threadWaitRead :: Fd -> IO ()
Block the current thread until data is available to read on the given file descriptor
threadWaitWrite :: Fd -> IO ()
Block the current thread until data can be written to the given file descriptor