[Haskell-cafe] Why doesn't this work?
emax at chalmers.se
Sun Aug 24 12:17:23 EDT 2008
BTW, this is a case where it may be more convenient to use forM:
forM ps $ \pix -> do
particle <- read_grid g pix
return $ fn particle
forM is just another way of saying (flip mapM).
Andrew Coppin skrev:
> colour_grid :: (Particle -> IO ()) -> Grid ph -> IO ()
> colour_grid fn g = sequence_ $ runST $ do
> ps <- grid_coords g
> (\pix -> do
> particle <- read_grid g pix
> return $ fn particle
> When I attempt to run this, GHCi just gives me a very cryptic type
> checker error. I can't figure out what's wrong here. As far as I can
> tell, this should run...
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe