Is Haskell’s mapM not lazy?
Well, there’s lazy, and then there’s lazy. mapM is indeed lazy in that it doesn’t do more work than it has to. However, look at the type signature: mapM :: (Monad m) => (a -> m b) -> [a] -> m [b] Think about what this means: You give it a function a -> m … Read more