[Haskell-cafe] Why doesn't this work?

Daniel Fischer daniel.is.fischer at web.de
Sun Aug 24 11:36:18 EDT 2008

Am Sonntag, 24. August 2008 17:21 schrieb Yitzchak Gale:
> Alfonso Acosta wrote:
> > I haven't tried to run the code, but my first bet is that, due to the
> > rank-2 polymorphism of ST, you should use parenthesis instead of $ in
> > the case of runST.
> Perhaps if Andrew is using an old compiler.
> That is no longer a problem in recent versions of GHC.
> A more basic issue is that fn is in the IO monad,
> but its use inside the mapM will need it to be in the ST
> monad.

return (fn particle) :: ST s (IO ())
, so that's fine.

Indeed, filling in a few dummies, the code compiles with the 6.8 branch.

> Regards,
> Yitz


More information about the Haskell-Cafe mailing list