[Haskell-cafe] What is MonadPlus good for?

Tomasz Zielonka tomasz.zielonka at gmail.com
Sun Feb 13 16:33:06 EST 2005

On Sun, Feb 13, 2005 at 10:25:49PM +0100, Remi Turk wrote:
> > BTW, I have an implementation of STM based entirely on old concurrency
> > primitives, which means that it will work in older GHC and probably in
> > other Haskell compilers. I am going to put it on my web site, when I get
> > one.
> Cool :)
> Is it actually race/deadlock/othergeneralnastiness-free?

It should be, but there may be bugs of course.
I know there are some possible space leaks, but that's also fixable.

> (as the paper claims that e.g. mergeIO :: [IO a] -> IO a is
> unimplementable in anything built on mutexes and condition
> variables.)

My STM monad is not IO, it has the same restrictions as STM in the
paper. The paper doesn't claim you can't implement mergeSTM :: [STM a]
-> STM a mergeSTM = msum

Also, the STM in GHC 6.4 is written in C. Do you think that Haskell's 
IO monad lacks some things needed to write this thing? I can tell you
there are some problems with types, but they can be solved in a more or
less standard way.

Best regards

Szukamy programisty C++ i Haskell'a: http://tinyurl.com/5mw4e

More information about the Haskell-Cafe mailing list