[commit: ghc] master: Add Bifoldable and Bitraversable to base (270d545)
git at git.haskell.org
git at git.haskell.org
Sat Jun 18 22:23:41 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/270d545d557352d5f264247987ee8388f0812187/ghc
>---------------------------------------------------------------
commit 270d545d557352d5f264247987ee8388f0812187
Author: Ryan Scott <ryan.gl.scott at gmail.com>
Date: Sat Jun 18 12:17:24 2016 +0200
Add Bifoldable and Bitraversable to base
This adds `Data.Bifoldable` and `Data.Bitraversable` from the
`bifunctors` package to `base`, completing the migration started in
D336. This is fairly straightforward, although there were a suprising
amount of reinternal organization in `base` that was needed for this to
happen:
* `Data.Foldable`, `Data.Traversable`, `Data.Bifoldable`, and
`Data.Bitraversable` share some nonexported datatypes (e.g., `StateL`,
`StateR`, `Min`, `Max`, etc.) to implement some instances. To avoid
code duplication, I migrated this internal code to a new hidden
module, `Data.Functor.Utils` (better naming suggestions welcome).
* `Data.Traversable` and `Data.Bitraversable` also make use of an
identity newtype, so I modified them to use
`Data.Functor.Identity.Identity`. This has a ripple effect on several
other modules, since I had to move instances around in order to avoid
dependency cycles.
Fixes #10448.
Reviewers: ekmett, hvr, austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2284
GHC Trac Issues: #9682, #10448
>---------------------------------------------------------------
270d545d557352d5f264247987ee8388f0812187
libraries/base/Control/Monad/Zip.hs | 6 +
libraries/base/Data/Bifoldable.hs | 428 +++++++++++++++++++++
libraries/base/Data/Bitraversable.hs | 228 +++++++++++
libraries/base/Data/Data.hs | 28 +-
libraries/base/Data/Foldable.hs | 64 +--
libraries/base/Data/Functor/Identity.hs | 34 +-
libraries/base/Data/Functor/Utils.hs | 106 +++++
libraries/base/Data/Semigroup.hs | 31 +-
libraries/base/Data/String.hs | 10 +-
libraries/base/Data/Traversable.hs | 50 +--
libraries/base/base.cabal | 3 +
libraries/base/changelog.md | 3 +
.../tests/annotations/should_fail/annfail10.stderr | 4 +-
testsuite/tests/perf/compiler/all.T | 3 +-
.../tests/typecheck/should_fail/T10971b.stderr | 8 +-
15 files changed, 847 insertions(+), 159 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 270d545d557352d5f264247987ee8388f0812187
More information about the ghc-commits
mailing list