performCommand2 :: Grid2 s -> Command -> ST s ()
performCommand2 grid (Command a r) = do
  let cs = coordsInRange r
  forM_ cs $ \c -> do
    b <- readArray grid c
    writeArray grid c $ performAction2 a b
performCommand2 :: Grid2 s -> Command -> ST s ()
performCommand2 grid (Command a r) = do
  let cs = coordsInRange r
  forM_ cs $ \c -> do
    b <- readArray grid c
    writeArray grid c $ performAction2 a b
performCommand2 grid (Command a r) = do
  let cs = coordsInRange r
  forM_ cs $ \c -> do
    b <- readArray grid c
    writeArray grid c $ performAction2 a b