[Haskell-cafe] ANN: threads-0.1.0.1

Bas van Dijk v.dijk.bas at gmail.com
Thu May 20 17:05:09 EDT 2010


Dear all,

I uploaded threads-0.1.0.1 to hackage. Threads is a small package that
lets you fork threads and wait for their result.

The basic interface is simply:

module Control.Concurrent.Thread where
  data ThreadId α
  forkIO ∷ IO α → IO (ThreadId α)
  wait ∷ ThreadId α → IO (Either SomeException α)
  threadId ∷ ThreadId α → Control.Concurrent.ThreadId

I hope the names and types speak for themselves.

Additionally the following module is provided that lets you wait for a
group of threads to terminate:

module Control.Concurrent.Thread.Group where
  data ThreadGroup
  new ∷ IO ThreadGroup
  forkIO ∷ ThreadGroup → IO α → IO (ThreadId α)
  wait ∷ ThreadGroup → IO ()

Installation:
$ cabal update
$ cabal install threads

API docs: http://hackage.haskell.org/package/threads-0.1.0.1

Development:
darcs get http://code.haskell.org/~basvandijk/code/threads

Regards,

Bas


More information about the Haskell-Cafe mailing list