Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

foldrM #136

Open
mrsekut opened this issue Jun 18, 2021 · 3 comments
Open

foldrM #136

mrsekut opened this issue Jun 18, 2021 · 3 comments
Labels
type: enhancement A new feature or addition.

Comments

@mrsekut
Copy link

mrsekut commented Jun 18, 2021

Is there any reason why there is foldlM (foldM) and there is no foldrM?
I was confused because I didn't hit when I searched for this in pursuit.

foldrM :: forall a m b f. Foldable f => Monad m => (a -> b -> m b) -> b -> f a -> m b
foldrM f z0 xs = foldl c pure xs z0
  where c k x z = f x z >>= k
@JordanMartinez
Copy link
Contributor

It was probably an oversight?

@hdgarrood
Copy link
Contributor

I think because nobody has asked for it before, and I think not adding things to the core libraries if there isn't a clear demand for them is generally a good strategy. (That's not to say that we can't add it now, though).

@hdgarrood
Copy link
Contributor

There's some discussion in #111.

@JordanMartinez JordanMartinez added the type: enhancement A new feature or addition. label Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A new feature or addition.
Projects
None yet
Development

No branches or pull requests

3 participants