haskell / containers

Assorted concrete container types
https://hackage.haskell.org/package/containers
315 stars 178 forks source link

Add foldlWithKeyM #793

Open andrewthad opened 3 years ago

andrewthad commented 3 years ago

The type would be:

foldlWithKeyM :: Monad m => (a -> k -> b -> m a) -> a -> Map k b -> m a

I'm happy to contribute this if it would be accepted.

treeowl commented 3 years ago

Why only the left fold?

On Sat, Aug 14, 2021, 10:46 AM Andrew Martin @.***> wrote:

The type would be:

foldlWithKeyM :: Monad m => (a -> k -> b -> m a) -> a -> Map k b -> m a

I'm happy to contribute this if it would be accepted.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/haskell/containers/issues/793, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOOF7NO2ZVGQB34D6IQ5ZTT4Z6T3ANCNFSM5CFFCLIQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

andrewthad commented 3 years ago

I could add the right variant as well. I haven’t ever needed it, but it would be good to have as well.

treeowl commented 3 years ago

I think that's best, since the containers are mostly quite symmetrical.

On Sun, Aug 15, 2021, 8:05 AM Andrew Martin @.***> wrote:

I could add the right variant as well. I haven’t ever needed it, but it would be good to have as well.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/haskell/containers/issues/793#issuecomment-899040406, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOOF7K5TF6A2OYVPV5LA3TT46UPNANCNFSM5CFFCLIQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

andrewthad commented 3 years ago

See https://github.com/haskell/containers/pull/795 and we can continue discussion there.