[Haskell-cafe] ANN: forkable-monad 0.1
dave at natulte.net
Wed Apr 21 18:25:13 EDT 2010
On Wed, Apr 21, 2010 at 4:09 PM, Limestraël <limestrael at gmail.com> wrote:
> Nice initiative!
> 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?
>> 2010/4/21 David Anderson <dave at 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 at haskell.org
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe