Add a strict version of foldMap to Foldable
ClosedPublic

Authored by sjakobi on Jul 2 2018, 7:51 PM.

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
sjakobi created this revision.Jul 2 2018, 7:51 PM
sjakobi updated this revision to Diff 17168.Jul 3 2018, 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.Jul 3 2018, 5:45 AM
  • Use (<>) instead of mappend
alpmestan accepted this revision.Jul 4 2018, 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.Jul 4 2018, 10:26 AM
sjakobi planned changes to this revision.Jul 4 2018, 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.Jul 4 2018, 11:12 AM
bgamari requested changes to this revision.Jul 6 2018, 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.Jul 6 2018, 9:59 AM
sjakobi updated this revision to Diff 17229.Jul 7 2018, 1:20 AM
  • Bump version in @since annotation
sjakobi marked an inline comment as done.Jul 7 2018, 1:21 AM
tdammers accepted this revision.Jul 9 2018, 7:14 AM
bgamari requested changes to this revision.Aug 21 2018, 11:07 AM

Can you add an entry to libraries/base/Changelog.md?

This revision now requires changes to proceed.Aug 21 2018, 11:07 AM
sjakobi updated this revision to Diff 17964.Sep 10 2018, 9:14 PM

Rebase & changelog entry

The test failures look unrelated to me.

bgamari accepted this revision.Oct 8 2018, 3:40 PM

Whoops, looks like I dropped the ball on this one. Looks good to me. I'll amend the changelog appropriately.

This revision is now accepted and ready to land.Oct 8 2018, 3:40 PM
This revision was automatically updated to reflect the committed changes.