On Wed, Apr 21, 2010 at 4:09 PM, Limestraƫl <limestr...@gmail.com> wrote: > Nice initiative!
Thanks! > By the way, since this is a monad, I think a better place than > Control.Concurrent.Forkable would be Control.Monad.Forkable. > It's just a suggestion. I'm not entirely happy with the location with the module, but with the current implementation where the type class defines only forkIO, I think it should live in Control.Concurrent. Since it doesn't define a new monad, but only a concurrency-specific restriction on existing monads, it seems that Control.Monad would be the wrong home. Am I missing something? Cheers, - Dave > > >> >> 2010/4/21 David Anderson <d...@natulte.net> >>> >>> Dear Haskellers, >>> >>> I'm happy, and only slightly intimidated, to announce the initial >>> release of forkable-monad. >>> >>> The short version is that forkable-monad exports a replacement forkIO >>> that lets you do this: >>> >>> type MyMonad = ReaderT Config (StateT Ctx IO) >>> >>> startThread :: MyMonad ThreadId >>> startThread = forkIO threadMain >>> >>> threadMain :: MyMonad () >>> threadMain = forever $ liftIO $ putStrLn "Painless monad stack forking!" >>> >>> Note the lack of monad stack deconstruction and reconstruction to >>> transport it over to the new thread. You'll find the details in the >>> Haddock documentation for the module. >>> >>> forkable-monad is available: >>> >>> * On hackage: http://hackage.haskell.org/package/forkable-monad >>> * Via cabal: cabal install forkable-monad >>> * Source and issue tracker: http://code.google.com/p/forkable-monad/ >>> >>> Feedback is of course welcome. As this is my first published Haskell >>> code and Hackage upload, I expect there will be quite a bit! >>> >>> - Dave >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe@haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe