Add various instances to newtypes in Data.Monoid
ClosedPublic

Authored by phadej on Feb 22 2015, 6:37 AM.

Details

Summary

Add Functor instances for Dual, Sum and Product
Add Foldable instances for Dual, Sum and Product
Add Traversable instances for Dual, Sum and Product
Add Foldable and Traversable instances for First and Last
Add Applicative, Monad instances to Dual, Sum, Product
Add MonadFix to Data.Monoid wrappers
Derive Data for Identity
Add Data instances to Data.Monoid wrappers
Add Data (Alt f a) instance

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.
phadej updated this revision to Diff 2277.Feb 22 2015, 6:37 AM
phadej retitled this revision from to Add various instances to newtypes in Data.Monoid.
phadej updated this object.
phadej edited the test plan for this revision. (Show Details)
phadej updated the Trac tickets for this revision.
phadej updated this revision to Diff 2280.Feb 22 2015, 10:44 AM
phadej edited edge metadata.
  • Update tests
hvr requested changes to this revision.Feb 22 2015, 11:47 AM
hvr edited edge metadata.
hvr added inline comments.
libraries/base/Data/Functor/Identity.hs
44 ↗(On Diff #2280)

this has been already taken care of by 1f60d635cee1ff3db72e0129f9035b147f52c9c4

This revision now requires changes to proceed.Feb 22 2015, 11:47 AM
dfeuer accepted this revision.Feb 22 2015, 11:58 AM
dfeuer edited edge metadata.

I like sum=getSum. Very cute.

phadej updated this revision to Diff 2283.Feb 22 2015, 12:04 PM
phadej edited edge metadata.
  • Revert "Derive Data for Identity" (by hvr comment)
austin accepted this revision.Feb 23 2015, 8:36 AM
austin edited edge metadata.

lgtm

This revision was automatically updated to reflect the committed changes.
ekmett edited edge metadata.Mar 3 2015, 11:25 AM

While we're in there, these also need MonadZip instances.

Otherwise, looks good to me.