Add Foldable and Traversable instances for ((,) a)
These instances are pretty obvious, and no more or less trivial than the existing instances for Prelude types. I have found them to be useful.
Since we are touching these modules anyway, I am attaching two additional minor patches to this proposal.
One is to add a few additional explicit method implementations in the Foldable and Traversable instances for Prelude types. These might sometimes be slightly more efficient, and they better match the strictness and style of the existing explicit method implementations.
The other is to fix the documentation for the functions fmapDefault and foldMapDefault in Data.Traversable. Contrary to what is stated, these cannot be used as methods in superclasses, since the superclasses must already exist before these functions can be defined. Instead, I have paraphrased what is stated in the documentation above: that the corresponding superclass methods should be equivalent to these.
Discussion period: two weeks.
Trac metadata
Trac field | Value |
---|---|
Version | 6.11 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | libraries/base |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |