containers icon indicating copy to clipboard operation
containers copied to clipboard

Add strict foldlWithKeyM

Open andrewthad opened this issue 4 years ago • 10 comments

Resolves https://github.com/haskell/containers/issues/793

This is just the implementation of a single monadic fold. @treeowl if you confirm that this implementation of this particular function looks good, I can add all of the lazy folds and the right folds as well

andrewthad avatar Aug 16 '21 15:08 andrewthad

@treeowl Do you have any feedback on this?

andrewthad avatar Aug 25 '21 14:08 andrewthad

I don't think monadic folds should be strict.

On Mon, Aug 16, 2021, 11:06 AM Andrew Martin @.***> wrote:

Resolves #793 https://github.com/haskell/containers/issues/793

This is just the implementation of a single monadic fold. @treeowl https://github.com/treeowl if you confirm that this implementation of this particular function looks good, I can add all of the lazy folds and the right folds as well

You can view, comment on, or merge this pull request online at:

https://github.com/haskell/containers/pull/795 Commit Summary

  • Add strict foldlWithKeyM

File Changes

Patch Links:

  • https://github.com/haskell/containers/pull/795.patch
  • https://github.com/haskell/containers/pull/795.diff

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/haskell/containers/pull/795, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOOF7NWPXNYAOCGPOGPC5DT5ESOLANCNFSM5CH5OETQ . 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 .

treeowl avatar Aug 25 '21 16:08 treeowl

I've changed this in the most recent commit. I think I'll have:

  • left monadic fold on map
  • right monadic fold on map
  • left monadic fold on intmap
  • right monadic fold on intmap

Anything else you'd like to see in that list.

andrewthad avatar Aug 25 '21 16:08 andrewthad

Yeah, could you get me some pizza? I've been missing the really good stuff.

On Wed, Aug 25, 2021, 12:27 PM Andrew Martin @.***> wrote:

I've changed this in the most recent commit. I think I'll have:

  • left monadic fold on map
  • right monadic fold on map
  • left monadic fold on intmap
  • right monadic fold on intmap

Anything else you'd like to see in that list.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/haskell/containers/pull/795#issuecomment-905688155, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOOF7NXUFRWXYXLSDOGJFLT6UKYZANCNFSM5CH5OETQ . 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 .

treeowl avatar Aug 25 '21 16:08 treeowl

I live in Atlanta, so all the truly good pizza is a ways up the east coast from me.

andrewthad avatar Aug 25 '21 16:08 andrewthad

Oh darn. Guess I'll have to make you pizza if you come visit (D.C. area).

On Wed, Aug 25, 2021, 12:33 PM Andrew Martin @.***> wrote:

I live in Atlanta, so all the truly good pizza is a ways up the east coast from me.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/haskell/containers/pull/795#issuecomment-905692275, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOOF7IDZIB4557ALSMBIOLT6ULPFANCNFSM5CH5OETQ . 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 .

treeowl avatar Aug 25 '21 16:08 treeowl

@treeowl This seems like an uncontroversial (and welcome) addition, how can we move this PR forward?

ocramz avatar Jan 03 '23 21:01 ocramz

Is there anything I can do to move this forward?

andrewthad avatar Aug 16 '23 19:08 andrewthad

I got sick a few weeks ago, and then went on family vacation. I expect to be ready to get back to my GitHub backlog by next Thursday. If this is ready for review, could you mark it as such?

treeowl avatar Aug 16 '23 21:08 treeowl

I've squashed and rebased. This adds foldlWithKeyM and foldrWithKeyM functions for the Data.Map data structure, both of which are lazy in the accumulator. It's ready for review.

andrewthad avatar Aug 17 '23 12:08 andrewthad