[Haskell-beginners] "sleep" in Haskell

Magnus Therning magnus at therning.org
Thu Oct 15 03:49:27 EDT 2009


On Thu, Oct 15, 2009 at 12:20 AM, aditya siram <aditya.siram at gmail.com> wrote:
> Look here:
> http://haskell.org/ghc/docs/latest/html/libraries/base/Control-Concurrent.html#v:threadDelay
>
> Here is a sample function that delays for 3 seconds and then dies:
> main :: IO ()
> main = do
>     threadDelay 30000
>     return ()

Sorry, but I can't help myself... the above is equivalent to

  main :: IO ()
  main = threadDelay 3000

/M

-- 
Magnus Therning                        (OpenPGP: 0xAB4DFBA4)
magnus@therning.org          Jabber: magnus@therning.org
http://therning.org/magnus         identi.ca|twitter: magthe


More information about the Beginners mailing list