[Haskell-cafe] ReaderT and concurrency

Andrew Pimlott andrew at pimlott.net
Wed Nov 16 12:45:17 EST 2005

On Wed, Nov 16, 2005 at 11:51:19AM -0500, Kurt Hutchinson wrote:
> I have to perform another runReaderT when forking? Or is there a way
> to get the ReaderT environment automatically carried over to the newly
> created Set B thread?

This is an unavoidable pain as far as I know.  It would be nice if
forkIO were defined in terms of MonadIO:

    forkIO :: MonadIO m => m () -> m ThreadId

(Same with forkProcess.)  I haven't thought too hard about it, but it
seems that it should be possible.


More information about the Haskell-Cafe mailing list