ekmett / profunctors

Haskell 98 Profunctors
http://hackage.haskell.org/package/profunctors
Other
70 stars 43 forks source link

Add folds to Traversing #85

Open guaraqe opened 4 years ago

guaraqe commented 4 years ago

This adds foldMap-like functions to Traversing. They are more efficient than doing rmap fold . traverse' because they never materialize the output structure.

I added them with these names since there is not a Folding typeclass in the profunctors hierarchy.

guaraqe commented 4 years ago

I added a foldMapOf' function that is equivalent to that in lens. I put this in a separate commit in case you deem it is not adequate to this package.

guibou commented 3 years ago

FYI, rebased version here: https://github.com/guibou/profunctors