We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d6905a6 commit ea905c3Copy full SHA for ea905c3
src/Data/Foldable.purs
@@ -177,8 +177,8 @@ fold = foldMap identity
177
-- |
178
-- | Note: this function is not generally stack-safe, e.g., for monads which
179
-- | build up thunks a la `Eff`.
180
-foldM :: forall f m a b. Foldable f => Monad m => (a -> b -> m a) -> a -> f b -> m a
181
-foldM f a0 = foldl (\ma b -> ma >>= flip f b) (pure a0)
+foldM :: forall f m a b. Foldable f => Monad m => (b -> a -> m b) -> b -> f a -> m b
+foldM f b0 = foldl (\b a -> b >>= flip f a) (pure b0)
182
183
-- | Traverse a data structure, performing some effects encoded by an
184
-- | `Applicative` functor at each value, ignoring the final result.
0 commit comments