Add a strict version of foldMap to Foldable
Needs ReviewPublic

Authored by sjakobi on Mon, Jul 2, 7:51 PM.
sjakobi created this revision.Mon, Jul 2, 7:51 PM
sjakobi updated this revision to Diff 17168.Tue, Jul 3, 5:13 AM
  • Remove bang pattern – we're using foldl'!

I'm pretty sure you don't need a bang pattern on acc when you use foldl'. Also, <> is preferable to mappend here, since SMP has happened.

sjakobi updated this revision to Diff 17169.Tue, Jul 3, 5:45 AM
  • Use (<>) instead of mappend
alpmestan accepted this revision.Wed, Jul 4, 10:26 AM
alpmestan added a subscriber: alpmestan.

I was confused initially by the fact that the revision title talks about adding foldMap' while in fact this changes an existing implementation. LGTM.

This revision is now accepted and ready to land.Wed, Jul 4, 10:26 AM
sjakobi planned changes to this revision.Wed, Jul 4, 11:05 AM

Oops. Looks like I lost my first commit that in fact added the foldMap' method.

This revision is now accepted and ready to land.Wed, Jul 4, 11:12 AM
bgamari requested changes to this revision.Fri, Jul 6, 9:59 AM
bgamari added inline comments.
libraries/base/Data/Foldable.hs
135

I'm afraid this has missed the window for 8.6. Can you bump this to 4.13?

This revision now requires changes to proceed.Fri, Jul 6, 9:59 AM
sjakobi updated this revision to Diff 17229.Sat, Jul 7, 1:20 AM
  • Bump version in @since annotation
sjakobi marked an inline comment as done.Sat, Jul 7, 1:21 AM
tdammers accepted this revision.Mon, Jul 9, 7:14 AM