returnM, thenM, thenM_, failM,
mappM, mappM_, sequenceM, foldlM,
mapAndUnzipM, mapAndUnzip3M,
- checkM, ifM,
+ checkM, ifM, zipWithM, zipWithM_,
-- Getting at the environment
getEnv, setEnv, updEnv,
mappM_ f [] = return ()
mappM_ f (x:xs) = f x >> mappM_ f xs
+zipWithM :: (a -> b -> IOEnv env c) -> [a] -> [b] -> IOEnv env [c]
+zipWithM f [] bs = return []
+zipWithM f as [] = return []
+zipWithM f (a:as) (b:bs) = do { r <- f a b; rs <- zipWithM f as bs; return (r:rs) }
+
+zipWithM_ :: (a -> b -> IOEnv env c) -> [a] -> [b] -> IOEnv env ()
+zipWithM_ f [] bs = return ()
+zipWithM_ f as [] = return ()
+zipWithM_ f (a:as) (b:bs) = do { f a b; zipWithM_ f as bs }
+
sequenceM [] = return []
sequenceM (x:xs) = do { r <- x; rs <- sequenceM xs; return (r:rs) }