Hello community,
here is the log from the commit of package ghc-bifunctors for
openSUSE:Leap:15.2 checked in at 2020-02-19 18:37:55
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2/ghc-bifunctors (Old)
and /work/SRC/openSUSE:Leap:15.2/.ghc-bifunctors.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-bifunctors"
Wed Feb 19 18:37:55 2020 rev:11 rq:771239 version:5.5.6
Changes:
--------
--- /work/SRC/openSUSE:Leap:15.2/ghc-bifunctors/ghc-bifunctors.changes
2020-01-15 15:00:42.237756229 +0100
+++
/work/SRC/openSUSE:Leap:15.2/.ghc-bifunctors.new.26092/ghc-bifunctors.changes
2020-02-19 18:37:55.977883046 +0100
@@ -1,0 +2,40 @@
+Wed Nov 27 03:00:47 UTC 2019 - [email protected]
+
+- Update bifunctors to version 5.5.6.
+ 5.5.6 [2019.11.26]
+ ------------------
+ * Add `Category`, `Arrow`, `ArrowChoice`, `ArrowLoop`, `ArrowZero`, and
+ `ArrowPlus` instances for `Data.Bifunctor.Product`.
+
+-------------------------------------------------------------------
+Fri Nov 8 16:13:19 UTC 2019 - Peter Simons <[email protected]>
+
+- Drop obsolete group attributes.
+
+-------------------------------------------------------------------
+Wed Aug 28 02:02:23 UTC 2019 - [email protected]
+
+- Update bifunctors to version 5.5.5.
+ 5.5.5 [2019.08.27]
+ ------------------
+ * Add `Eq{1,2}`, `Ord{1,2}`, `Read{1,2}`, and `Show{1,2}` instances for data
+ types in the `Data.Bifunctor.*` module namespace where possible. The
+ operative phrase is "where possible" since many of these instances require
+ the use of `Eq2`/`Ord2`/`Read2`/`Show2`, which are not avaiable when
+ built against `transformers-0.4.*`.
+
+-------------------------------------------------------------------
+Tue Jun 11 14:29:08 UTC 2019 - Peter Simons <[email protected]>
+
+- Update Cabal file for more accurate build dependencies.
+
+-------------------------------------------------------------------
+Tue Apr 30 09:23:08 UTC 2019 - [email protected]
+
+- Update bifunctors to version 5.5.4.
+ 5.5.4 [2019.04.26]
+ ------------------
+ * Support `th-abstraction-0.3` or later.
+ * Don't incur a `semigroup` dependency on recent GHCs.
+
+-------------------------------------------------------------------
Old:
----
bifunctors-5.5.3.tar.gz
New:
----
bifunctors-5.5.6.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-bifunctors.spec ++++++
--- /var/tmp/diff_new_pack.H4slcT/_old 2020-02-19 18:37:56.305883732 +0100
+++ /var/tmp/diff_new_pack.H4slcT/_new 2020-02-19 18:37:56.305883732 +0100
@@ -1,7 +1,7 @@
#
# spec file for package ghc-bifunctors
#
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,11 +19,10 @@
%global pkg_name bifunctors
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 5.5.3
+Version: 5.5.6
Release: 0
Summary: Collection Haskell 98 bifunctors, bifoldables and
bitraversables
License: BSD-2-Clause
-Group: Development/Libraries/Haskell
URL: https://hackage.haskell.org/package/%{pkg_name}
Source0:
https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
BuildRequires: ghc-Cabal-devel
@@ -31,7 +30,6 @@
BuildRequires: ghc-comonad-devel
BuildRequires: ghc-containers-devel
BuildRequires: ghc-rpm-macros
-BuildRequires: ghc-semigroups-devel
BuildRequires: ghc-tagged-devel
BuildRequires: ghc-template-haskell-devel
BuildRequires: ghc-th-abstraction-devel
@@ -47,7 +45,6 @@
%package devel
Summary: Haskell %{pkg_name} library development files
-Group: Development/Libraries/Haskell
Requires: %{name} = %{version}-%{release}
Requires: ghc-compiler = %{ghc_version}
Requires(post): ghc-compiler = %{ghc_version}
++++++ bifunctors-5.5.3.tar.gz -> bifunctors-5.5.6.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/bifunctors-5.5.3/.travis.yml
new/bifunctors-5.5.6/.travis.yml
--- old/bifunctors-5.5.3/.travis.yml 2018-07-04 21:03:37.000000000 +0200
+++ new/bifunctors-5.5.6/.travis.yml 2001-09-09 03:46:40.000000000 +0200
@@ -1,159 +1,208 @@
# This Travis job script has been generated by a script via
#
-# runghc make_travis_yml_2.hs '-o' '.travis.yml' '--ghc-head'
'--irc-channel=irc.freenode.org#haskell-lens' '--no-no-tests-no-bench'
'--no-unconstrained' 'cabal.project'
+# haskell-ci '--output=.travis.yml' '--config=cabal.haskell-ci'
'cabal.project'
#
-# For more information, see https://github.com/hvr/multi-ghc-travis
+# For more information, see https://github.com/haskell-CI/haskell-ci
#
+# version: 0.9.20191126
+#
+version: ~> 1.0
language: c
-sudo: false
-
+os: linux
+dist: xenial
git:
- submodules: false # whether to recursively clone submodules
-
+ # whether to recursively clone submodules
+ submodules: false
notifications:
irc:
channels:
- - "irc.freenode.org#haskell-lens"
+ - irc.freenode.org#haskell-lens
skip_join: true
template:
- - "\x0313bifunctors\x03/\x0306%{branch}\x03 \x0314%{commit}\x03
%{build_url} %{message}"
-
+ - "\"\\x0313bifunctors\\x03/\\x0306%{branch}\\x03 \\x0314%{commit}\\x03
%{build_url} %{message}\""
cache:
directories:
- $HOME/.cabal/packages
- $HOME/.cabal/store
-
+ - $HOME/.hlint
before_cache:
- - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
+ - rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log
# remove files that are regenerated by 'cabal update'
- - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.*
- - rm -fv $HOME/.cabal/packages/hackage.haskell.org/*.json
- - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.cache
- - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar
- - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar.idx
-
- - rm -rfv $HOME/.cabal/packages/head.hackage
-
-matrix:
+ - rm -fv $CABALHOME/packages/hackage.haskell.org/00-index.*
+ - rm -fv $CABALHOME/packages/hackage.haskell.org/*.json
+ - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.cache
+ - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar
+ - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar.idx
+ - rm -rfv $CABALHOME/packages/head.hackage
+jobs:
include:
- - compiler: "ghc-8.6.1"
- env: GHCHEAD=true
- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.6.1],
sources: [hvr-ghc]}}
- - compiler: "ghc-8.4.3"
- # env: TEST=--disable-tests BENCH=--disable-benchmarks
- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-8.4.3],
sources: [hvr-ghc]}}
- - compiler: "ghc-8.2.2"
- # env: TEST=--disable-tests BENCH=--disable-benchmarks
- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-8.2.2],
sources: [hvr-ghc]}}
- - compiler: "ghc-8.0.2"
- # env: TEST=--disable-tests BENCH=--disable-benchmarks
- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-8.0.2],
sources: [hvr-ghc]}}
- - compiler: "ghc-7.10.3"
- # env: TEST=--disable-tests BENCH=--disable-benchmarks
- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.10.3],
sources: [hvr-ghc]}}
- - compiler: "ghc-7.8.4"
- # env: TEST=--disable-tests BENCH=--disable-benchmarks
- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.8.4],
sources: [hvr-ghc]}}
- - compiler: "ghc-7.6.3"
- # env: TEST=--disable-tests BENCH=--disable-benchmarks
- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.6.3],
sources: [hvr-ghc]}}
- - compiler: "ghc-7.4.2"
- # env: TEST=--disable-tests BENCH=--disable-benchmarks
- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.4.2],
sources: [hvr-ghc]}}
- - compiler: "ghc-7.2.2"
- # env: TEST=--disable-tests BENCH=--disable-benchmarks
- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.2.2],
sources: [hvr-ghc]}}
- - compiler: "ghc-7.0.4"
- # env: TEST=--disable-tests BENCH=--disable-benchmarks
- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.0.4],
sources: [hvr-ghc]}}
- - compiler: "ghc-head"
- env: GHCHEAD=true
- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-head],
sources: [hvr-ghc]}}
-
+ - compiler: ghc-8.10.1
+ addons: {"apt":{"sources":[{"sourceline":"deb
http://ppa.launchpad.net/hvr/ghc/ubuntu xenial
main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.10.1","cabal-install-3.0"]}}
+ os: linux
+ - compiler: ghc-8.8.1
+ addons: {"apt":{"sources":[{"sourceline":"deb
http://ppa.launchpad.net/hvr/ghc/ubuntu xenial
main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.8.1","cabal-install-3.0"]}}
+ os: linux
+ - compiler: ghc-8.6.5
+ addons: {"apt":{"sources":[{"sourceline":"deb
http://ppa.launchpad.net/hvr/ghc/ubuntu xenial
main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.6.5","cabal-install-3.0"]}}
+ os: linux
+ - compiler: ghc-8.4.4
+ addons: {"apt":{"sources":[{"sourceline":"deb
http://ppa.launchpad.net/hvr/ghc/ubuntu xenial
main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.4.4","cabal-install-3.0"]}}
+ os: linux
+ - compiler: ghc-8.2.2
+ addons: {"apt":{"sources":[{"sourceline":"deb
http://ppa.launchpad.net/hvr/ghc/ubuntu xenial
main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.2.2","cabal-install-3.0"]}}
+ os: linux
+ - compiler: ghc-8.0.2
+ addons: {"apt":{"sources":[{"sourceline":"deb
http://ppa.launchpad.net/hvr/ghc/ubuntu xenial
main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.0.2","cabal-install-3.0"]}}
+ os: linux
+ - compiler: ghc-7.10.3
+ addons: {"apt":{"sources":[{"sourceline":"deb
http://ppa.launchpad.net/hvr/ghc/ubuntu xenial
main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-7.10.3","cabal-install-3.0"]}}
+ os: linux
+ - compiler: ghc-7.8.4
+ addons: {"apt":{"sources":[{"sourceline":"deb
http://ppa.launchpad.net/hvr/ghc/ubuntu xenial
main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-7.8.4","cabal-install-3.0"]}}
+ os: linux
+ - compiler: ghc-7.6.3
+ addons: {"apt":{"sources":[{"sourceline":"deb
http://ppa.launchpad.net/hvr/ghc/ubuntu xenial
main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-7.6.3","cabal-install-3.0"]}}
+ os: linux
+ - compiler: ghc-7.4.2
+ addons: {"apt":{"sources":[{"sourceline":"deb
http://ppa.launchpad.net/hvr/ghc/ubuntu xenial
main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-7.4.2","cabal-install-3.0"]}}
+ os: linux
+ - compiler: ghc-7.2.2
+ addons: {"apt":{"sources":[{"sourceline":"deb
http://ppa.launchpad.net/hvr/ghc/ubuntu xenial
main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-7.2.2","cabal-install-3.0"]}}
+ os: linux
+ - compiler: ghc-7.0.4
+ addons: {"apt":{"sources":[{"sourceline":"deb
http://ppa.launchpad.net/hvr/ghc/ubuntu xenial
main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-7.0.4","cabal-install-3.0"]}}
+ os: linux
+ - compiler: ghc-head
+ addons: {"apt":{"sources":[{"sourceline":"deb
http://ppa.launchpad.net/hvr/ghc/ubuntu xenial
main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-head","cabal-install-head"]}}
+ os: linux
allow_failures:
- - compiler: "ghc-head"
- - compiler: "ghc-7.0.4"
- - compiler: "ghc-7.2.2"
- - compiler: "ghc-8.6.1"
-
+ - compiler: ghc-head
+ - compiler: ghc-7.0.4
+ - compiler: ghc-7.2.2
+ - compiler: ghc-8.10.1
before_install:
- - HC=${CC}
- - HCPKG=${HC/ghc/ghc-pkg}
+ - HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')
+ - WITHCOMPILER="-w $HC"
+ - HADDOCK=$(echo "/opt/$CC/bin/haddock" | sed 's/-/\//')
+ - HCPKG="$HC-pkg"
- unset CC
- - ROOTDIR=$(pwd)
- - mkdir -p $HOME/.local/bin
- - "PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$HOME/local/bin:$PATH"
- - HCNUMVER=$(( $(${HC} --numeric-version|sed -E
's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') ))
+ - CABAL=/opt/ghc/bin/cabal
+ - CABALHOME=$HOME/.cabal
+ - export PATH="$CABALHOME/bin:$PATH"
+ - TOP=$(pwd)
+ - "HCNUMVER=$(${HC} --numeric-version|perl -ne
'/^(\\d+)\\.(\\d+)\\.(\\d+)(\\.(\\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 ==
0 ? $5 != 1 : $3))')"
- echo $HCNUMVER
-
+ - CABAL="$CABAL -vnormal+nowrap+markoutput"
+ - set -o pipefail
+ - |
+ echo 'function blue(s) { printf "\033[0;34m" s "\033[0m " }' >>
.colorful.awk
+ echo 'BEGIN { state = "output"; }' >>
.colorful.awk
+ echo '/^-----BEGIN CABAL OUTPUT-----$/ { state = "cabal" }' >>
.colorful.awk
+ echo '/^-----END CABAL OUTPUT-----$/ { state = "output" }' >>
.colorful.awk
+ echo '!/^(-----BEGIN CABAL OUTPUT-----|-----END CABAL OUTPUT-----)/ {' >>
.colorful.awk
+ echo ' if (state == "cabal") {' >>
.colorful.awk
+ echo ' print blue($0)' >>
.colorful.awk
+ echo ' } else {' >>
.colorful.awk
+ echo ' print $0' >>
.colorful.awk
+ echo ' }' >>
.colorful.awk
+ echo '}' >>
.colorful.awk
+ - cat .colorful.awk
+ - |
+ color_cabal_output () {
+ awk -f $TOP/.colorful.awk
+ }
+ - echo text | color_cabal_output
install:
- - cabal --version
+ - ${CABAL} --version
- echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2>
/dev/null || echo '?')]"
- - BENCH=${BENCH---enable-benchmarks}
- - TEST=${TEST---enable-tests}
- - HADDOCK=${HADDOCK-true}
- - UNCONSTRAINED=${UNCONSTRAINED-true}
- - NOINSTALLEDCONSTRAINTS=${NOINSTALLEDCONSTRAINTS-false}
- - GHCHEAD=${GHCHEAD-false}
- - travis_retry cabal update -v
- - "sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config"
- - rm -fv cabal.project cabal.project.local
- # Overlay Hackage Package Index for GHC HEAD:
https://github.com/hvr/head.hackage
- - |
- if $GHCHEAD; then
- sed -i 's/-- allow-newer: .*/allow-newer: *:base/' ${HOME}/.cabal/config
- for pkg in $($HCPKG list --simple-output); do pkg=$(echo $pkg | sed
's/-[^-]*$//'); sed -i "s/allow-newer: /allow-newer: *:$pkg, /"
${HOME}/.cabal/config; done
-
- echo 'repository head.hackage'
>> ${HOME}/.cabal/config
- echo ' url: http://head.hackage.haskell.org/'
>> ${HOME}/.cabal/config
- echo ' secure: True'
>> ${HOME}/.cabal/config
- echo ' root-keys:
07c59cb65787dedfaef5bd5f987ceb5f7e5ebf88b904bbd4c5cbdeb2ff71b740' >>
${HOME}/.cabal/config
- echo '
2e8555dde16ebd8df076f1a8ef13b8f14c66bad8eafefd7d9e37d0ed711821fb' >>
${HOME}/.cabal/config
- echo '
8f79fd2389ab2967354407ec852cbe73f2e8635793ac446d09461ffb99527f6e' >>
${HOME}/.cabal/config
- echo ' key-threshold: 3'
>> ${HOME}/.cabal.config
-
- grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'
-
- cabal new-update head.hackage -v
+ - TEST=--enable-tests
+ - BENCH=--enable-benchmarks
+ - HEADHACKAGE=false
+ - if [ $HCNUMVER -ge 81000 ] ; then HEADHACKAGE=true ; fi
+ - rm -f $CABALHOME/config
+ - |
+ echo "verbose: normal +nowrap +markoutput"
>> $CABALHOME/config
+ echo "remote-build-reporting: anonymous"
>> $CABALHOME/config
+ echo "write-ghc-environment-files: always"
>> $CABALHOME/config
+ echo "remote-repo-cache: $CABALHOME/packages"
>> $CABALHOME/config
+ echo "logs-dir: $CABALHOME/logs"
>> $CABALHOME/config
+ echo "world-file: $CABALHOME/world"
>> $CABALHOME/config
+ echo "extra-prog-path: $CABALHOME/bin"
>> $CABALHOME/config
+ echo "symlink-bindir: $CABALHOME/bin"
>> $CABALHOME/config
+ echo "installdir: $CABALHOME/bin"
>> $CABALHOME/config
+ echo "build-summary: $CABALHOME/logs/build.log"
>> $CABALHOME/config
+ echo "store-dir: $CABALHOME/store"
>> $CABALHOME/config
+ echo "install-dirs user"
>> $CABALHOME/config
+ echo " prefix: $CABALHOME"
>> $CABALHOME/config
+ echo "repository hackage.haskell.org"
>> $CABALHOME/config
+ echo " url: http://hackage.haskell.org/"
>> $CABALHOME/config
+ echo " secure: True"
>> $CABALHOME/config
+ echo " key-threshold: 3"
>> $CABALHOME/config
+ echo " root-keys:"
>> $CABALHOME/config
+ echo "
fe331502606802feac15e514d9b9ea83fee8b6ffef71335479a2e68d84adc6b0" >>
$CABALHOME/config
+ echo "
1ea9ba32c526d1cc91ab5e5bd364ec5e9e8cb67179a471872f6e26f0ae773d42" >>
$CABALHOME/config
+ echo "
2c6c3627bd6c982990239487f1abd02e08a02e6cf16edb105a8012d444d870c3" >>
$CABALHOME/config
+ echo "
0a5c7ea47cd1b15f01f5f51a33adda7e655bc0f0b0615baa8e271f4c3351e21d" >>
$CABALHOME/config
+ echo "
51f0161b906011b52c6613376b1ae937670da69322113a246a09f807c62f6921" >>
$CABALHOME/config
+ - |
+ if $HEADHACKAGE; then
+ echo "allow-newer: $($HCPKG list --simple-output | sed -E
's/([a-zA-Z-]+)-[0-9.]+/*:\1/g')" >> $CABALHOME/config
+ echo "repository head.hackage.ghc.haskell.org"
>> $CABALHOME/config
+ echo " url: https://ghc.gitlab.haskell.org/head.hackage/"
>> $CABALHOME/config
+ echo " secure: True"
>> $CABALHOME/config
+ echo " root-keys:
7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d" >>
$CABALHOME/config
+ echo "
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329" >>
$CABALHOME/config
+ echo "
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89" >>
$CABALHOME/config
+ echo " key-threshold: 3"
>> $CABALHOME/config
fi
- - grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'
- - "printf 'packages: \".\"\\n' > cabal.project"
- - touch cabal.project.local
- - "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list
--simple-output); do echo $pkg | sed 's/^/constraints: /' | sed 's/-[^-]*$/
installed/' >> cabal.project.local; done; fi"
+ - |
+ echo "program-default-options" >> $CABALHOME/config
+ echo " ghc-options: $GHCJOBS +RTS -M6G -RTS" >> $CABALHOME/config
+ - cat $CABALHOME/config
+ - rm -fv cabal.project cabal.project.local cabal.project.freeze
+ - travis_retry ${CABAL} v2-update -v
+ # Generate cabal.project
+ - rm -rf cabal.project cabal.project.local cabal.project.freeze
+ - touch cabal.project
+ - |
+ echo "packages: ." >> cabal.project
+ - |
+ - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed
's/-[^-]*$//' | (grep -vE -- '^(bifunctors)$' || true) | sed 's/^/constraints:
/' | sed 's/$/ installed/' >> cabal.project.local; done"
- cat cabal.project || true
- cat cabal.project.local || true
- - if [ -f "./configure.ac" ]; then
- (cd "." && autoreconf -i);
- fi
- - rm -f cabal.project.freeze
- - cabal new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project"
--dep -j2 all
- - rm -rf .ghc.environment.* "."/dist
- - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
-
-# Here starts the actual work to be performed for the package under test;
-# any command which exits with a non-zero exit code causes the build to fail.
+ - if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi
+ - ${CABAL} v2-freeze $WITHCOMPILER ${TEST} ${BENCH} | color_cabal_output
+ - "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed
's/any.//'"
+ - rm cabal.project.freeze
+ - ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} --dep -j2 all |
color_cabal_output
script:
- # test that source-distributions can be generated
- - (cd "." && cabal sdist)
- - mv "."/dist/bifunctors-*.tar.gz ${DISTDIR}/
+ - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
+ # Packaging...
+ - ${CABAL} v2-sdist all | color_cabal_output
+ # Unpacking...
+ - mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
- cd ${DISTDIR} || false
- - find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
- - "printf 'packages: bifunctors-*/*.cabal\\n' > cabal.project"
- - touch cabal.project.local
- - "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list
--simple-output); do echo $pkg | sed 's/^/constraints: /' | sed 's/-[^-]*$/
installed/' >> cabal.project.local; done; fi"
+ - find . -maxdepth 1 -type f -name '*.tar.gz' -exec tar -xvf '{}' \;
+ - find . -maxdepth 1 -type f -name '*.tar.gz' -exec rm '{}' \;
+ - PKGDIR_bifunctors="$(find . -maxdepth 1 -type d -regex
'.*/bifunctors-[0-9.]*')"
+ # Generate cabal.project
+ - rm -rf cabal.project cabal.project.local cabal.project.freeze
+ - touch cabal.project
+ - |
+ echo "packages: ${PKGDIR_bifunctors}" >> cabal.project
+ - |
+ - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed
's/-[^-]*$//' | (grep -vE -- '^(bifunctors)$' || true) | sed 's/^/constraints:
/' | sed 's/$/ installed/' >> cabal.project.local; done"
- cat cabal.project || true
- cat cabal.project.local || true
-
+ # Building with tests and benchmarks...
# build & run tests, build benchmarks
- - cabal new-build -w ${HC} ${TEST} ${BENCH} all
- - if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST}
${BENCH} all; fi
-
- # cabal check
- - (cd bifunctors-* && cabal check)
-
- # haddock
- - rm -rf ./dist-newstyle
- - if $HADDOCK; then cabal new-haddock -w ${HC} ${TEST} ${BENCH} all; else
echo "Skipping haddock generation";fi
+ - ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} all | color_cabal_output
+ # Testing...
+ - ${CABAL} v2-test $WITHCOMPILER ${TEST} ${BENCH} all | color_cabal_output
+ # cabal check...
+ - (cd ${PKGDIR_bifunctors} && ${CABAL} -vnormal check)
+ # haddock...
+ - ${CABAL} v2-haddock $WITHCOMPILER --with-haddock $HADDOCK ${TEST} ${BENCH}
all | color_cabal_output
-# REGENDATA
["-o",".travis.yml","--ghc-head","--irc-channel=irc.freenode.org#haskell-lens","--no-no-tests-no-bench","--no-unconstrained","cabal.project"]
+# REGENDATA
("0.9.20191126",["--output=.travis.yml","--config=cabal.haskell-ci","cabal.project"])
# EOF
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/bifunctors-5.5.3/CHANGELOG.markdown
new/bifunctors-5.5.6/CHANGELOG.markdown
--- old/bifunctors-5.5.3/CHANGELOG.markdown 2018-07-04 21:03:37.000000000
+0200
+++ new/bifunctors-5.5.6/CHANGELOG.markdown 2001-09-09 03:46:40.000000000
+0200
@@ -1,3 +1,21 @@
+5.5.6 [2019.11.26]
+------------------
+* Add `Category`, `Arrow`, `ArrowChoice`, `ArrowLoop`, `ArrowZero`, and
+ `ArrowPlus` instances for `Data.Bifunctor.Product`.
+
+5.5.5 [2019.08.27]
+------------------
+* Add `Eq{1,2}`, `Ord{1,2}`, `Read{1,2}`, and `Show{1,2}` instances for data
+ types in the `Data.Bifunctor.*` module namespace where possible. The
+ operative phrase is "where possible" since many of these instances require
+ the use of `Eq2`/`Ord2`/`Read2`/`Show2`, which are not avaiable when
+ built against `transformers-0.4.*`.
+
+5.5.4 [2019.04.26]
+------------------
+* Support `th-abstraction-0.3` or later.
+* Don't incur a `semigroup` dependency on recent GHCs.
+
5.5.3 [2018.07.04]
------------------
* Make `biliftA2` a class method of `Biapplicative`.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/bifunctors-5.5.3/bifunctors.cabal
new/bifunctors-5.5.6/bifunctors.cabal
--- old/bifunctors-5.5.3/bifunctors.cabal 2018-07-04 21:03:37.000000000
+0200
+++ new/bifunctors-5.5.6/bifunctors.cabal 2001-09-09 03:46:40.000000000
+0200
@@ -1,6 +1,6 @@
name: bifunctors
category: Data, Functors
-version: 5.5.3
+version: 5.5.6
license: BSD3
cabal-version: >= 1.8
license-file: LICENSE
@@ -21,9 +21,15 @@
, GHC == 7.10.3
, GHC == 8.0.2
, GHC == 8.2.2
- , GHC == 8.4.3
- , GHC == 8.6.1
-extra-source-files: .travis.yml CHANGELOG.markdown README.markdown
+ , GHC == 8.4.4
+ , GHC == 8.6.5
+ , GHC == 8.8.1
+ , GHC == 8.10.1
+extra-source-files:
+ .travis.yml
+ CHANGELOG.markdown
+ README.markdown
+ include/bifunctors-common.h
source-repository head
type: git
@@ -47,13 +53,15 @@
library
hs-source-dirs: src
+ include-dirs: include
+ includes: bifunctors-common.h
build-depends:
base >= 4 && < 5,
base-orphans >= 0.5.2 && < 1,
comonad >= 4 && < 6,
containers >= 0.1 && < 0.7,
- template-haskell >= 2.4 && < 2.15,
- th-abstraction >= 0.2.2 && < 0.3,
+ template-haskell >= 2.4 && < 2.17,
+ th-abstraction >= 0.3 && < 0.4,
transformers >= 0.2 && < 0.6
if !impl(ghc > 8.2)
@@ -62,7 +70,7 @@
if flag(tagged)
build-depends: tagged >= 0.7.3 && < 1
- if flag(semigroups)
+ if flag(semigroups) && !impl(ghc >= 8.0)
build-depends: semigroups >= 0.8.3.1 && < 1
if impl(ghc<7.9)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/bifunctors-5.5.3/include/bifunctors-common.h
new/bifunctors-5.5.6/include/bifunctors-common.h
--- old/bifunctors-5.5.3/include/bifunctors-common.h 1970-01-01
01:00:00.000000000 +0100
+++ new/bifunctors-5.5.6/include/bifunctors-common.h 2001-09-09
03:46:40.000000000 +0200
@@ -0,0 +1,19 @@
+#ifndef MIN_VERSION_base
+#define MIN_VERSION_base(x,y,z) 1
+#endif
+
+#ifndef MIN_VERSION_transformers_compat
+#define MIN_VERSION_transformers_compat(x,y,z) 0
+#endif
+
+#if MIN_VERSION_base(4,9,0)
+#define LIFTED_FUNCTOR_CLASSES 1
+#else
+#if MIN_VERSION_transformers(0,5,0)
+#define LIFTED_FUNCTOR_CLASSES 1
+#else
+#if MIN_VERSION_transformers_compat(0,5,0) && !MIN_VERSION_transformers(0,4,0)
+#define LIFTED_FUNCTOR_CLASSES 1
+#endif
+#endif
+#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/bifunctors-5.5.3/old-src/ghc801/Data/Bitraversable.hs
new/bifunctors-5.5.6/old-src/ghc801/Data/Bitraversable.hs
--- old/bifunctors-5.5.3/old-src/ghc801/Data/Bitraversable.hs 2018-07-04
21:03:37.000000000 +0200
+++ new/bifunctors-5.5.6/old-src/ghc801/Data/Bitraversable.hs 2001-09-09
03:46:40.000000000 +0200
@@ -86,7 +86,7 @@
--
-- [/composition/]
-- @'Compose' . 'fmap' ('bitraverse' g1 g2) . 'bitraverse' f1 f2
--- ≡ 'traverse' ('Compose' . 'fmap' g1 . f1) ('Compose' . 'fmap' g2 . f2)@
+-- ≡ 'bitraverse' ('Compose' . 'fmap' g1 . f1) ('Compose' . 'fmap' g2 .
f2)@
--
-- where an /applicative transformation/ is a function
--
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/bifunctors-5.5.3/src/Data/Bifunctor/Biff.hs
new/bifunctors-5.5.6/src/Data/Bifunctor/Biff.hs
--- old/bifunctors-5.5.3/src/Data/Bifunctor/Biff.hs 2018-07-04
21:03:37.000000000 +0200
+++ new/bifunctors-5.5.6/src/Data/Bifunctor/Biff.hs 2001-09-09
03:46:40.000000000 +0200
@@ -19,6 +19,7 @@
#elif __GLASGOW_HASKELL__ >= 702
{-# LANGUAGE Trustworthy #-}
#endif
+#include "bifunctors-common.h"
-----------------------------------------------------------------------------
-- |
@@ -56,6 +57,10 @@
import GHC.Generics
#endif
+#if LIFTED_FUNCTOR_CLASSES
+import Data.Functor.Classes
+#endif
+
-- | Compose two 'Functor's on the inside of a 'Bifunctor'.
newtype Biff p f g a b = Biff { runBiff :: p (f a) (g b) }
deriving ( Eq, Ord, Show, Read
@@ -93,6 +98,39 @@
# endif
#endif
+#if LIFTED_FUNCTOR_CLASSES
+instance (Eq2 p, Eq1 f, Eq1 g, Eq a) => Eq1 (Biff p f g a) where
+ liftEq = liftEq2 (==)
+instance (Eq2 p, Eq1 f, Eq1 g) => Eq2 (Biff p f g) where
+ liftEq2 f g (Biff x) (Biff y) = liftEq2 (liftEq f) (liftEq g) x y
+
+instance (Ord2 p, Ord1 f, Ord1 g, Ord a) => Ord1 (Biff p f g a) where
+ liftCompare = liftCompare2 compare
+instance (Ord2 p, Ord1 f, Ord1 g) => Ord2 (Biff p f g) where
+ liftCompare2 f g (Biff x) (Biff y) = liftCompare2 (liftCompare f)
(liftCompare g) x y
+
+instance (Read2 p, Read1 f, Read1 g, Read a) => Read1 (Biff p f g a) where
+ liftReadsPrec = liftReadsPrec2 readsPrec readList
+instance (Read2 p, Read1 f, Read1 g) => Read2 (Biff p f g) where
+ liftReadsPrec2 rp1 rl1 rp2 rl2 p = readParen (p > 10) $ \s0 -> do
+ ("Biff", s1) <- lex s0
+ ("{", s2) <- lex s1
+ ("runBiff", s3) <- lex s2
+ (x, s4) <- liftReadsPrec2 (liftReadsPrec rp1 rl1) (liftReadList
rp1 rl1)
+ (liftReadsPrec rp2 rl2) (liftReadList
rp2 rl2) 0 s3
+ ("}", s5) <- lex s4
+ return (Biff x, s5)
+
+instance (Show2 p, Show1 f, Show1 g, Show a) => Show1 (Biff p f g a) where
+ liftShowsPrec = liftShowsPrec2 showsPrec showList
+instance (Show2 p, Show1 f, Show1 g) => Show2 (Biff p f g) where
+ liftShowsPrec2 sp1 sl1 sp2 sl2 p (Biff x) = showParen (p > 10) $
+ showString "Biff {runBiff = "
+ . liftShowsPrec2 (liftShowsPrec sp1 sl1) (liftShowList sp1 sl1)
+ (liftShowsPrec sp2 sl2) (liftShowList sp2 sl2) 0 x
+ . showChar '}'
+#endif
+
instance (Bifunctor p, Functor f, Functor g) => Bifunctor (Biff p f g) where
first f = Biff . first (fmap f) . runBiff
{-# INLINE first #-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/bifunctors-5.5.3/src/Data/Bifunctor/Clown.hs
new/bifunctors-5.5.6/src/Data/Bifunctor/Clown.hs
--- old/bifunctors-5.5.3/src/Data/Bifunctor/Clown.hs 2018-07-04
21:03:37.000000000 +0200
+++ new/bifunctors-5.5.6/src/Data/Bifunctor/Clown.hs 2001-09-09
03:46:40.000000000 +0200
@@ -16,6 +16,7 @@
#elif __GLASGOW_HASKELL__ >= 702
{-# LANGUAGE Trustworthy #-}
#endif
+#include "bifunctors-common.h"
-----------------------------------------------------------------------------
-- |
@@ -40,6 +41,7 @@
import Data.Biapplicative
import Data.Bifoldable
import Data.Bitraversable
+import Data.Functor.Classes
#if __GLASGOW_HASKELL__ < 710
import Data.Foldable
@@ -93,6 +95,67 @@
to1 = Clown . unK1 . unM1 . unM1 . unM1
#endif
+#if LIFTED_FUNCTOR_CLASSES
+instance (Eq1 f, Eq a) => Eq1 (Clown f a) where
+ liftEq = liftEq2 (==)
+instance Eq1 f => Eq2 (Clown f) where
+ liftEq2 f _ = eqClown (liftEq f)
+
+instance (Ord1 f, Ord a) => Ord1 (Clown f a) where
+ liftCompare = liftCompare2 compare
+instance Ord1 f => Ord2 (Clown f) where
+ liftCompare2 f _ = compareClown (liftCompare f)
+
+instance (Read1 f, Read a) => Read1 (Clown f a) where
+ liftReadsPrec = liftReadsPrec2 readsPrec readList
+instance Read1 f => Read2 (Clown f) where
+ liftReadsPrec2 rp1 rl1 _ _ = readsPrecClown (liftReadsPrec rp1 rl1)
+
+instance (Show1 f, Show a) => Show1 (Clown f a) where
+ liftShowsPrec = liftShowsPrec2 showsPrec showList
+instance Show1 f => Show2 (Clown f) where
+ liftShowsPrec2 sp1 sl1 _ _ = showsPrecClown (liftShowsPrec sp1 sl1)
+#else
+instance (Eq1 f, Eq a) => Eq1 (Clown f a) where
+ eq1 = eqClown eq1
+
+instance (Ord1 f, Ord a) => Ord1 (Clown f a) where
+ compare1 = compareClown compare1
+
+instance (Read1 f, Read a) => Read1 (Clown f a) where
+ readsPrec1 = readsPrecClown readsPrec1
+
+instance (Show1 f, Show a) => Show1 (Clown f a) where
+ showsPrec1 = showsPrecClown showsPrec1
+#endif
+
+eqClown :: (f a1 -> f a2 -> Bool)
+ -> Clown f a1 b1 -> Clown f a2 b2 -> Bool
+eqClown eqA (Clown x) (Clown y) = eqA x y
+
+compareClown :: (f a1 -> f a2 -> Ordering)
+ -> Clown f a1 b1 -> Clown f a2 b2 -> Ordering
+compareClown compareA (Clown x) (Clown y) = compareA x y
+
+readsPrecClown :: (Int -> ReadS (f a))
+ -> Int -> ReadS (Clown f a b)
+readsPrecClown rpA p =
+ readParen (p > 10) $ \s0 -> do
+ ("Clown", s1) <- lex s0
+ ("{", s2) <- lex s1
+ ("runClown", s3) <- lex s2
+ (x, s4) <- rpA 0 s3
+ ("}", s5) <- lex s4
+ return (Clown x, s5)
+
+showsPrecClown :: (Int -> f a -> ShowS)
+ -> Int -> Clown f a b -> ShowS
+showsPrecClown spA p (Clown x) =
+ showParen (p > 10) $
+ showString "Clown {runClown = "
+ . spA 0 x
+ . showChar '}'
+
instance Functor f => Bifunctor (Clown f) where
first f = Clown . fmap f . runClown
{-# INLINE first #-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/bifunctors-5.5.3/src/Data/Bifunctor/Fix.hs
new/bifunctors-5.5.6/src/Data/Bifunctor/Fix.hs
--- old/bifunctors-5.5.3/src/Data/Bifunctor/Fix.hs 2018-07-04
21:03:37.000000000 +0200
+++ new/bifunctors-5.5.6/src/Data/Bifunctor/Fix.hs 2001-09-09
03:46:40.000000000 +0200
@@ -17,6 +17,7 @@
#if __GLASGOW_HASKELL__ >= 706
{-# LANGUAGE PolyKinds #-}
#endif
+#include "bifunctors-common.h"
-----------------------------------------------------------------------------
-- |
@@ -54,6 +55,10 @@
import GHC.Generics
#endif
+#if LIFTED_FUNCTOR_CLASSES
+import Data.Functor.Classes
+#endif
+
-- | Greatest fixpoint of a 'Bifunctor' (a 'Functor' over the first argument
with zipping).
newtype Fix p a = In { out :: p (Fix p a) a }
deriving
@@ -71,6 +76,30 @@
deriving instance Show (p (Fix p a) a) => Show (Fix p a)
deriving instance Read (p (Fix p a) a) => Read (Fix p a)
+#if LIFTED_FUNCTOR_CLASSES
+instance Eq2 p => Eq1 (Fix p) where
+ liftEq f (In x) (In y) = liftEq2 (liftEq f) f x y
+
+instance Ord2 p => Ord1 (Fix p) where
+ liftCompare f (In x) (In y) = liftCompare2 (liftCompare f) f x y
+
+instance Read2 p => Read1 (Fix p) where
+ liftReadsPrec rp1 rl1 p = readParen (p > 10) $ \s0 -> do
+ ("In", s1) <- lex s0
+ ("{", s2) <- lex s1
+ ("out", s3) <- lex s2
+ (x, s4) <- liftReadsPrec2 (liftReadsPrec rp1 rl1) (liftReadList rp1
rl1)
+ rp1 rl1 0 s3
+ ("}", s5) <- lex s4
+ return (In x, s5)
+
+instance Show2 p => Show1 (Fix p) where
+ liftShowsPrec sp1 sl1 p (In x) = showParen (p > 10) $
+ showString "In {out = "
+ . liftShowsPrec2 (liftShowsPrec sp1 sl1) (liftShowList sp1 sl1)
+ sp1 sl1 0 x
+ . showChar '}'
+#endif
instance Bifunctor p => Functor (Fix p) where
fmap f (In p) = In (bimap (fmap f) f p)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/bifunctors-5.5.3/src/Data/Bifunctor/Flip.hs
new/bifunctors-5.5.6/src/Data/Bifunctor/Flip.hs
--- old/bifunctors-5.5.3/src/Data/Bifunctor/Flip.hs 2018-07-04
21:03:37.000000000 +0200
+++ new/bifunctors-5.5.6/src/Data/Bifunctor/Flip.hs 2001-09-09
03:46:40.000000000 +0200
@@ -14,6 +14,7 @@
#if __GLASGOW_HASKELL__ >= 706
{-# LANGUAGE PolyKinds #-}
#endif
+#include "bifunctors-common.h"
-----------------------------------------------------------------------------
-- |
@@ -53,6 +54,10 @@
import GHC.Generics
#endif
+#if LIFTED_FUNCTOR_CLASSES
+import Data.Functor.Classes
+#endif
+
-- | Make a 'Bifunctor' flipping the arguments of a 'Bifunctor'.
newtype Flip p a b = Flip { runFlip :: p b a }
deriving ( Eq, Ord, Show, Read
@@ -64,6 +69,37 @@
#endif
)
+#if LIFTED_FUNCTOR_CLASSES
+instance (Eq2 p, Eq a) => Eq1 (Flip p a) where
+ liftEq = liftEq2 (==)
+instance Eq2 p => Eq2 (Flip p) where
+ liftEq2 f g (Flip x) (Flip y) = liftEq2 g f x y
+
+instance (Ord2 p, Ord a) => Ord1 (Flip p a) where
+ liftCompare = liftCompare2 compare
+instance Ord2 p => Ord2 (Flip p) where
+ liftCompare2 f g (Flip x) (Flip y) = liftCompare2 g f x y
+
+instance (Read2 p, Read a) => Read1 (Flip p a) where
+ liftReadsPrec = liftReadsPrec2 readsPrec readList
+instance Read2 p => Read2 (Flip p) where
+ liftReadsPrec2 rp1 rl1 rp2 rl2 p = readParen (p > 10) $ \s0 -> do
+ ("Flip", s1) <- lex s0
+ ("{", s2) <- lex s1
+ ("runFlip", s3) <- lex s2
+ (x, s4) <- liftReadsPrec2 rp2 rl2 rp1 rl1 0 s3
+ ("}", s5) <- lex s4
+ return (Flip x, s5)
+
+instance (Show2 p, Show a) => Show1 (Flip p a) where
+ liftShowsPrec = liftShowsPrec2 showsPrec showList
+instance Show2 p => Show2 (Flip p) where
+ liftShowsPrec2 sp1 sl1 sp2 sl2 p (Flip x) = showParen (p > 10) $
+ showString "Flip {runFlip = "
+ . liftShowsPrec2 sp2 sl2 sp1 sl1 0 x
+ . showChar '}'
+#endif
+
instance Bifunctor p => Bifunctor (Flip p) where
first f = Flip . second f . runFlip
{-# INLINE first #-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/bifunctors-5.5.3/src/Data/Bifunctor/Join.hs
new/bifunctors-5.5.6/src/Data/Bifunctor/Join.hs
--- old/bifunctors-5.5.3/src/Data/Bifunctor/Join.hs 2018-07-04
21:03:37.000000000 +0200
+++ new/bifunctors-5.5.6/src/Data/Bifunctor/Join.hs 2001-09-09
03:46:40.000000000 +0200
@@ -17,6 +17,7 @@
#if __GLASGOW_HASKELL__ >= 706
{-# LANGUAGE PolyKinds #-}
#endif
+#include "bifunctors-common.h"
-----------------------------------------------------------------------------
-- |
@@ -53,6 +54,10 @@
import GHC.Generics
#endif
+#if LIFTED_FUNCTOR_CLASSES
+import Data.Functor.Classes
+#endif
+
-- | Make a 'Functor' over both arguments of a 'Bifunctor'.
newtype Join p a = Join { runJoin :: p a a }
deriving
@@ -70,6 +75,29 @@
deriving instance Show (p a a) => Show (Join p a)
deriving instance Read (p a a) => Read (Join p a)
+#if LIFTED_FUNCTOR_CLASSES
+instance Eq2 p => Eq1 (Join p) where
+ liftEq f (Join x) (Join y) = liftEq2 f f x y
+
+instance Ord2 p => Ord1 (Join p) where
+ liftCompare f (Join x) (Join y) = liftCompare2 f f x y
+
+instance Read2 p => Read1 (Join p) where
+ liftReadsPrec rp1 rl1 p = readParen (p > 10) $ \s0 -> do
+ ("Join", s1) <- lex s0
+ ("{", s2) <- lex s1
+ ("runJoin", s3) <- lex s2
+ (x, s4) <- liftReadsPrec2 rp1 rl1 rp1 rl1 0 s3
+ ("}", s5) <- lex s4
+ return (Join x, s5)
+
+instance Show2 p => Show1 (Join p) where
+ liftShowsPrec sp1 sl1 p (Join x) = showParen (p > 10) $
+ showString "Join {runJoin = "
+ . liftShowsPrec2 sp1 sl1 sp1 sl1 0 x
+ . showChar '}'
+#endif
+
instance Bifunctor p => Functor (Join p) where
fmap f (Join a) = Join (bimap f f a)
{-# INLINE fmap #-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/bifunctors-5.5.3/src/Data/Bifunctor/Joker.hs
new/bifunctors-5.5.6/src/Data/Bifunctor/Joker.hs
--- old/bifunctors-5.5.3/src/Data/Bifunctor/Joker.hs 2018-07-04
21:03:37.000000000 +0200
+++ new/bifunctors-5.5.6/src/Data/Bifunctor/Joker.hs 2001-09-09
03:46:40.000000000 +0200
@@ -16,6 +16,7 @@
#elif __GLASGOW_HASKELL__ >= 702
{-# LANGUAGE Trustworthy #-}
#endif
+#include "bifunctors-common.h"
-----------------------------------------------------------------------------
-- |
@@ -40,6 +41,7 @@
import Data.Biapplicative
import Data.Bifoldable
import Data.Bitraversable
+import Data.Functor.Classes
#if __GLASGOW_HASKELL__ < 710
import Data.Foldable
@@ -92,6 +94,67 @@
to1 = Joker . unRec1 . unM1 . unM1 . unM1
#endif
+#if LIFTED_FUNCTOR_CLASSES
+instance Eq1 g => Eq1 (Joker g a) where
+ liftEq g = eqJoker (liftEq g)
+instance Eq1 g => Eq2 (Joker g) where
+ liftEq2 _ g = eqJoker (liftEq g)
+
+instance Ord1 g => Ord1 (Joker g a) where
+ liftCompare g = compareJoker (liftCompare g)
+instance Ord1 g => Ord2 (Joker g) where
+ liftCompare2 _ g = compareJoker (liftCompare g)
+
+instance Read1 g => Read1 (Joker g a) where
+ liftReadsPrec rp rl = readsPrecJoker (liftReadsPrec rp rl)
+instance Read1 g => Read2 (Joker g) where
+ liftReadsPrec2 _ _ rp2 rl2 = readsPrecJoker (liftReadsPrec rp2 rl2)
+
+instance Show1 g => Show1 (Joker g a) where
+ liftShowsPrec sp sl = showsPrecJoker (liftShowsPrec sp sl)
+instance Show1 g => Show2 (Joker g) where
+ liftShowsPrec2 _ _ sp2 sl2 = showsPrecJoker (liftShowsPrec sp2 sl2)
+#else
+instance Eq1 g => Eq1 (Joker g a) where
+ eq1 = eqJoker eq1
+
+instance Ord1 g => Ord1 (Joker g a) where
+ compare1 = compareJoker compare1
+
+instance Read1 g => Read1 (Joker g a) where
+ readsPrec1 = readsPrecJoker readsPrec1
+
+instance Show1 g => Show1 (Joker g a) where
+ showsPrec1 = showsPrecJoker showsPrec1
+#endif
+
+eqJoker :: (g b1 -> g b2 -> Bool)
+ -> Joker g a1 b1 -> Joker g a2 b2 -> Bool
+eqJoker eqB (Joker x) (Joker y) = eqB x y
+
+compareJoker :: (g b1 -> g b2 -> Ordering)
+ -> Joker g a1 b1 -> Joker g a2 b2 -> Ordering
+compareJoker compareB (Joker x) (Joker y) = compareB x y
+
+readsPrecJoker :: (Int -> ReadS (g b))
+ -> Int -> ReadS (Joker g a b)
+readsPrecJoker rpB p =
+ readParen (p > 10) $ \s0 -> do
+ ("Joker", s1) <- lex s0
+ ("{", s2) <- lex s1
+ ("runJoker", s3) <- lex s2
+ (x, s4) <- rpB 0 s3
+ ("}", s5) <- lex s4
+ return (Joker x, s5)
+
+showsPrecJoker :: (Int -> g b -> ShowS)
+ -> Int -> Joker g a b -> ShowS
+showsPrecJoker spB p (Joker x) =
+ showParen (p > 10) $
+ showString "Joker {runJoker = "
+ . spB 0 x
+ . showChar '}'
+
instance Functor g => Bifunctor (Joker g) where
first _ = Joker . runJoker
{-# INLINE first #-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/bifunctors-5.5.3/src/Data/Bifunctor/Product.hs
new/bifunctors-5.5.6/src/Data/Bifunctor/Product.hs
--- old/bifunctors-5.5.3/src/Data/Bifunctor/Product.hs 2018-07-04
21:03:37.000000000 +0200
+++ new/bifunctors-5.5.6/src/Data/Bifunctor/Product.hs 2001-09-09
03:46:40.000000000 +0200
@@ -16,6 +16,7 @@
#elif __GLASGOW_HASKELL__ >= 702
{-# LANGUAGE Trustworthy #-}
#endif
+#include "bifunctors-common.h"
-----------------------------------------------------------------------------
-- |
@@ -36,6 +37,8 @@
import Control.Applicative
#endif
+import qualified Control.Arrow as A
+import Control.Category
import Data.Biapplicative
import Data.Bifoldable
import Data.Bifunctor.Functor
@@ -53,6 +56,12 @@
import GHC.Generics
#endif
+#if LIFTED_FUNCTOR_CLASSES
+import Data.Functor.Classes
+#endif
+
+import Prelude hiding ((.),id)
+
-- | Form the product of two bifunctors
data Product f g a b = Pair (f a b) (g a b)
deriving ( Eq, Ord, Show, Read
@@ -84,6 +93,36 @@
to1 (M1 (M1 (M1 f :*: M1 g))) = Pair (unRec1 f) (unRec1 g)
#endif
+#if LIFTED_FUNCTOR_CLASSES
+instance (Eq2 f, Eq2 g, Eq a) => Eq1 (Product f g a) where
+ liftEq = liftEq2 (==)
+instance (Eq2 f, Eq2 g) => Eq2 (Product f g) where
+ liftEq2 f g (Pair x1 y1) (Pair x2 y2) =
+ liftEq2 f g x1 x2 && liftEq2 f g y1 y2
+
+instance (Ord2 f, Ord2 g, Ord a) => Ord1 (Product f g a) where
+ liftCompare = liftCompare2 compare
+instance (Ord2 f, Ord2 g) => Ord2 (Product f g) where
+ liftCompare2 f g (Pair x1 y1) (Pair x2 y2) =
+ liftCompare2 f g x1 x2 `mappend` liftCompare2 f g y1 y2
+
+instance (Read2 f, Read2 g, Read a) => Read1 (Product f g a) where
+ liftReadsPrec = liftReadsPrec2 readsPrec readList
+instance (Read2 f, Read2 g) => Read2 (Product f g) where
+ liftReadsPrec2 rp1 rl1 rp2 rl2 = readsData $
+ readsBinaryWith (liftReadsPrec2 rp1 rl1 rp2 rl2)
+ (liftReadsPrec2 rp1 rl1 rp2 rl2)
+ "Pair" Pair
+
+instance (Show2 f, Show2 g, Show a) => Show1 (Product f g a) where
+ liftShowsPrec = liftShowsPrec2 showsPrec showList
+instance (Show2 f, Show2 g) => Show2 (Product f g) where
+ liftShowsPrec2 sp1 sl1 sp2 sl2 p (Pair x y) =
+ showsBinaryWith (liftShowsPrec2 sp1 sl1 sp2 sl2)
+ (liftShowsPrec2 sp1 sl1 sp2 sl2)
+ "Pair" p x y
+#endif
+
instance (Bifunctor f, Bifunctor g) => Bifunctor (Product f g) where
first f (Pair x y) = Pair (first f x) (first f y)
{-# INLINE first #-}
@@ -113,3 +152,29 @@
biextract (Pair _ q) = q
biduplicate pq@(Pair p _) = Pair p pq
biextend f pq@(Pair p _) = Pair p (f pq)
+
+instance (Category p, Category q) => Category (Product p q) where
+ id = Pair id id
+ Pair x y . Pair x' y' = Pair (x . x') (y . y')
+
+instance (A.Arrow p, A.Arrow q) => A.Arrow (Product p q) where
+ arr f = Pair (A.arr f) (A.arr f)
+ first (Pair x y) = Pair (A.first x) (A.first y)
+ second (Pair x y) = Pair (A.second x) (A.second y)
+ Pair x y *** Pair x' y' = Pair (x A.*** x') (y A.*** y')
+ Pair x y &&& Pair x' y' = Pair (x A.&&& x') (y A.&&& y')
+
+instance (A.ArrowChoice p, A.ArrowChoice q) => A.ArrowChoice (Product p q)
where
+ left (Pair x y) = Pair (A.left x) (A.left y)
+ right (Pair x y) = Pair (A.right x) (A.right y)
+ Pair x y +++ Pair x' y' = Pair (x A.+++ x') (y A.+++ y')
+ Pair x y ||| Pair x' y' = Pair (x A.||| x') (y A.||| y')
+
+instance (A.ArrowLoop p, A.ArrowLoop q) => A.ArrowLoop (Product p q) where
+ loop (Pair x y) = Pair (A.loop x) (A.loop y)
+
+instance (A.ArrowZero p, A.ArrowZero q) => A.ArrowZero (Product p q) where
+ zeroArrow = Pair A.zeroArrow A.zeroArrow
+
+instance (A.ArrowPlus p, A.ArrowPlus q) => A.ArrowPlus (Product p q) where
+ Pair x y <+> Pair x' y' = Pair (x A.<+> x') (y A.<+> y')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/bifunctors-5.5.3/src/Data/Bifunctor/Sum.hs
new/bifunctors-5.5.6/src/Data/Bifunctor/Sum.hs
--- old/bifunctors-5.5.3/src/Data/Bifunctor/Sum.hs 2018-07-04
21:03:37.000000000 +0200
+++ new/bifunctors-5.5.6/src/Data/Bifunctor/Sum.hs 2001-09-09
03:46:40.000000000 +0200
@@ -16,6 +16,7 @@
#elif __GLASGOW_HASKELL__ >= 702
{-# LANGUAGE Trustworthy #-}
#endif
+#include "bifunctors-common.h"
module Data.Bifunctor.Sum where
@@ -23,8 +24,10 @@
import Data.Bifunctor.Functor
import Data.Bifoldable
import Data.Bitraversable
+
#if __GLASGOW_HASKELL__ < 710
import Data.Functor
+import Data.Monoid hiding (Sum)
#endif
#if __GLASGOW_HASKELL__ >= 708
import Data.Typeable
@@ -32,6 +35,9 @@
#if __GLASGOW_HASKELL__ >= 702
import GHC.Generics
#endif
+#if LIFTED_FUNCTOR_CLASSES
+import Data.Functor.Classes
+#endif
data Sum p q a b = L2 (p a b) | R2 (q a b)
deriving ( Eq, Ord, Show, Read
@@ -69,6 +75,39 @@
to1 (M1 (R1 (M1 (M1 q)))) = R2 (unRec1 q)
#endif
+#if LIFTED_FUNCTOR_CLASSES
+instance (Eq2 f, Eq2 g, Eq a) => Eq1 (Sum f g a) where
+ liftEq = liftEq2 (==)
+instance (Eq2 f, Eq2 g) => Eq2 (Sum f g) where
+ liftEq2 f g (L2 x1) (L2 x2) = liftEq2 f g x1 x2
+ liftEq2 _ _ (L2 _) (R2 _) = False
+ liftEq2 _ _ (R2 _) (L2 _) = False
+ liftEq2 f g (R2 y1) (R2 y2) = liftEq2 f g y1 y2
+
+instance (Ord2 f, Ord2 g, Ord a) => Ord1 (Sum f g a) where
+ liftCompare = liftCompare2 compare
+instance (Ord2 f, Ord2 g) => Ord2 (Sum f g) where
+ liftCompare2 f g (L2 x1) (L2 x2) = liftCompare2 f g x1 x2
+ liftCompare2 _ _ (L2 _) (R2 _) = LT
+ liftCompare2 _ _ (R2 _) (L2 _) = GT
+ liftCompare2 f g (R2 y1) (R2 y2) = liftCompare2 f g y1 y2
+
+instance (Read2 f, Read2 g, Read a) => Read1 (Sum f g a) where
+ liftReadsPrec = liftReadsPrec2 readsPrec readList
+instance (Read2 f, Read2 g) => Read2 (Sum f g) where
+ liftReadsPrec2 rp1 rl1 rp2 rl2 = readsData $
+ readsUnaryWith (liftReadsPrec2 rp1 rl1 rp2 rl2) "L2" L2 `mappend`
+ readsUnaryWith (liftReadsPrec2 rp1 rl1 rp2 rl2) "R2" R2
+
+instance (Show2 f, Show2 g, Show a) => Show1 (Sum f g a) where
+ liftShowsPrec = liftShowsPrec2 showsPrec showList
+instance (Show2 f, Show2 g) => Show2 (Sum f g) where
+ liftShowsPrec2 sp1 sl1 sp2 sl2 p (L2 x) =
+ showsUnaryWith (liftShowsPrec2 sp1 sl1 sp2 sl2) "L2" p x
+ liftShowsPrec2 sp1 sl1 sp2 sl2 p (R2 y) =
+ showsUnaryWith (liftShowsPrec2 sp1 sl1 sp2 sl2) "R2" p y
+#endif
+
instance (Bifunctor p, Bifunctor q) => Bifunctor (Sum p q) where
bimap f g (L2 p) = L2 (bimap f g p)
bimap f g (R2 q) = R2 (bimap f g q)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/bifunctors-5.5.3/src/Data/Bifunctor/TH.hs
new/bifunctors-5.5.6/src/Data/Bifunctor/TH.hs
--- old/bifunctors-5.5.3/src/Data/Bifunctor/TH.hs 2018-07-04
21:03:37.000000000 +0200
+++ new/bifunctors-5.5.6/src/Data/Bifunctor/TH.hs 2001-09-09
03:46:40.000000000 +0200
@@ -350,17 +350,17 @@
deriveBiClass biClass opts name = do
info <- reifyDatatype name
case info of
- DatatypeInfo { datatypeContext = ctxt
- , datatypeName = parentName
- , datatypeVars = vars
- , datatypeVariant = variant
- , datatypeCons = cons
+ DatatypeInfo { datatypeContext = ctxt
+ , datatypeName = parentName
+ , datatypeInstTypes = instTys
+ , datatypeVariant = variant
+ , datatypeCons = cons
} -> do
(instanceCxt, instanceType)
- <- buildTypeInstance biClass parentName ctxt vars variant
+ <- buildTypeInstance biClass parentName ctxt instTys variant
(:[]) `fmap` instanceD (return instanceCxt)
(return instanceType)
- (biFunDecs biClass opts parentName vars cons)
+ (biFunDecs biClass opts parentName instTys cons)
-- | Generates a declaration defining the primary function(s) corresponding to
a
-- particular class (bimap for Bifunctor, bifoldr and bifoldMap for
Bifoldable, and
@@ -368,14 +368,14 @@
--
-- For why both bifoldr and bifoldMap are derived for Bifoldable, see Trac
#7436.
biFunDecs :: BiClass -> Options -> Name -> [Type] -> [ConstructorInfo] -> [Q
Dec]
-biFunDecs biClass opts parentName vars cons =
+biFunDecs biClass opts parentName instTys cons =
map makeFunD $ biClassToFuns biClass
where
makeFunD :: BiFun -> Q Dec
makeFunD biFun =
funD (biFunName biFun)
[ clause []
- (normalB $ makeBiFunForCons biFun opts parentName vars
cons)
+ (normalB $ makeBiFunForCons biFun opts parentName instTys
cons)
[]
]
@@ -384,22 +384,22 @@
makeBiFun biFun opts name = do
info <- reifyDatatype name
case info of
- DatatypeInfo { datatypeContext = ctxt
- , datatypeName = parentName
- , datatypeVars = vars
- , datatypeVariant = variant
- , datatypeCons = cons
+ DatatypeInfo { datatypeContext = ctxt
+ , datatypeName = parentName
+ , datatypeInstTypes = instTys
+ , datatypeVariant = variant
+ , datatypeCons = cons
} ->
-- We force buildTypeInstance here since it performs some checks for
whether
-- or not the provided datatype can actually have
bimap/bifoldr/bitraverse/etc.
-- implemented for it, and produces errors if it can't.
- buildTypeInstance (biFunToClass biFun) parentName ctxt vars variant
- >> makeBiFunForCons biFun opts parentName vars cons
+ buildTypeInstance (biFunToClass biFun) parentName ctxt instTys variant
+ >> makeBiFunForCons biFun opts parentName instTys cons
-- | Generates a lambda expression for the given constructors.
-- All constructors must be from the same type.
makeBiFunForCons :: BiFun -> Options -> Name -> [Type] -> [ConstructorInfo] ->
Q Exp
-makeBiFunForCons biFun opts _parentName vars cons = do
+makeBiFunForCons biFun opts _parentName instTys cons = do
argNames <- mapM newName $ catMaybes [ Just "f"
, Just "g"
, guard (biFun == Bifoldr) >> Just "z"
@@ -409,7 +409,7 @@
z = head others -- If we're deriving bifoldr, this will be well
defined
-- and useful. Otherwise, it'll be ignored.
value = last others
- lastTyVars = map varTToName $ drop (length vars - 2) vars
+ lastTyVars = map varTToName $ drop (length instTys - 2) instTys
tvMap = Map.fromList $ zip lastTyVars [map1, map2]
lamE (map varP argNames)
. appsE
@@ -613,15 +613,15 @@
-> DatatypeVariant
-- ^ Are we dealing with a data family instance or not
-> Q (Cxt, Type)
-buildTypeInstance biClass tyConName dataCxt varTysOrig variant = do
+buildTypeInstance biClass tyConName dataCxt instTysOrig variant = do
-- Make sure to expand through type/kind synonyms! Otherwise, the
-- eta-reduction check might get tripped up over type variables in a
-- synonym that are actually dropped.
-- (See GHC Trac #11416 for a scenario where this actually happened.)
- varTysExp <- mapM resolveTypeSynonyms varTysOrig
+ varTysExp <- mapM resolveTypeSynonyms instTysOrig
let remainingLength :: Int
- remainingLength = length varTysOrig - 2
+ remainingLength = length instTysOrig - 2
droppedTysExp :: [Type]
droppedTysExp = drop remainingLength varTysExp
@@ -687,7 +687,7 @@
remainingTysOrigSubst :: [Type]
remainingTysOrigSubst =
map (substNamesWithKindStar (union droppedKindVarNames kvNames'))
- $ take remainingLength varTysOrig
+ $ take remainingLength instTysOrig
isDataFamily :: Bool
isDataFamily = case variant of
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/bifunctors-5.5.3/src/Data/Bifunctor/Tannen.hs
new/bifunctors-5.5.6/src/Data/Bifunctor/Tannen.hs
--- old/bifunctors-5.5.3/src/Data/Bifunctor/Tannen.hs 2018-07-04
21:03:37.000000000 +0200
+++ new/bifunctors-5.5.6/src/Data/Bifunctor/Tannen.hs 2001-09-09
03:46:40.000000000 +0200
@@ -19,6 +19,7 @@
#elif __GLASGOW_HASKELL__ >= 702
{-# LANGUAGE Trustworthy #-}
#endif
+#include "bifunctors-common.h"
-----------------------------------------------------------------------------
-- |
@@ -60,6 +61,10 @@
import GHC.Generics
#endif
+#if LIFTED_FUNCTOR_CLASSES
+import Data.Functor.Classes
+#endif
+
import Prelude hiding ((.),id)
-- | Compose a 'Functor' on the outside of a 'Bifunctor'.
@@ -99,6 +104,39 @@
# endif
#endif
+#if LIFTED_FUNCTOR_CLASSES
+instance (Eq1 f, Eq2 p, Eq a) => Eq1 (Tannen f p a) where
+ liftEq = liftEq2 (==)
+instance (Eq1 f, Eq2 p) => Eq2 (Tannen f p) where
+ liftEq2 f g (Tannen x) (Tannen y) = liftEq (liftEq2 f g) x y
+
+instance (Ord1 f, Ord2 p, Ord a) => Ord1 (Tannen f p a) where
+ liftCompare = liftCompare2 compare
+instance (Ord1 f, Ord2 p) => Ord2 (Tannen f p) where
+ liftCompare2 f g (Tannen x) (Tannen y) = liftCompare (liftCompare2 f g) x y
+
+instance (Read1 f, Read2 p, Read a) => Read1 (Tannen f p a) where
+ liftReadsPrec = liftReadsPrec2 readsPrec readList
+instance (Read1 f, Read2 p) => Read2 (Tannen f p) where
+ liftReadsPrec2 rp1 rl1 rp2 rl2 p = readParen (p > 10) $ \s0 -> do
+ ("Tannen", s1) <- lex s0
+ ("{", s2) <- lex s1
+ ("runTannen", s3) <- lex s2
+ (x, s4) <- liftReadsPrec (liftReadsPrec2 rp1 rl1 rp2 rl2)
+ (liftReadList2 rp1 rl1 rp2 rl2) 0 s3
+ ("}", s5) <- lex s4
+ return (Tannen x, s5)
+
+instance (Show1 f, Show2 p, Show a) => Show1 (Tannen f p a) where
+ liftShowsPrec = liftShowsPrec2 showsPrec showList
+instance (Show1 f, Show2 p) => Show2 (Tannen f p) where
+ liftShowsPrec2 sp1 sl1 sp2 sl2 p (Tannen x) = showParen (p > 10) $
+ showString "Tannen {runTannen = "
+ . liftShowsPrec (liftShowsPrec2 sp1 sl1 sp2 sl2)
+ (liftShowList2 sp1 sl1 sp2 sl2) 0 x
+ . showChar '}'
+#endif
+
instance Functor f => BifunctorFunctor (Tannen f) where
bifmap f (Tannen fp) = Tannen (fmap f fp)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/bifunctors-5.5.3/src/Data/Bifunctor/Wrapped.hs
new/bifunctors-5.5.6/src/Data/Bifunctor/Wrapped.hs
--- old/bifunctors-5.5.3/src/Data/Bifunctor/Wrapped.hs 2018-07-04
21:03:37.000000000 +0200
+++ new/bifunctors-5.5.6/src/Data/Bifunctor/Wrapped.hs 2001-09-09
03:46:40.000000000 +0200
@@ -16,6 +16,7 @@
#elif __GLASGOW_HASKELL__ >= 702
{-# LANGUAGE Trustworthy #-}
#endif
+#include "bifunctors-common.h"
-----------------------------------------------------------------------------
-- |
@@ -53,6 +54,10 @@
import GHC.Generics
#endif
+#if LIFTED_FUNCTOR_CLASSES
+import Data.Functor.Classes
+#endif
+
-- | Make a 'Functor' over the second argument of a 'Bifunctor'.
newtype WrappedBifunctor p a b = WrapBifunctor { unwrapBifunctor :: p a b }
deriving ( Eq, Ord, Show, Read
@@ -89,6 +94,37 @@
to1 = WrapBifunctor . unRec1 . unM1 . unM1 . unM1
#endif
+#if LIFTED_FUNCTOR_CLASSES
+instance (Eq2 p, Eq a) => Eq1 (WrappedBifunctor p a) where
+ liftEq = liftEq2 (==)
+instance Eq2 p => Eq2 (WrappedBifunctor p) where
+ liftEq2 f g (WrapBifunctor x) (WrapBifunctor y) = liftEq2 f g x y
+
+instance (Ord2 p, Ord a) => Ord1 (WrappedBifunctor p a) where
+ liftCompare = liftCompare2 compare
+instance Ord2 p => Ord2 (WrappedBifunctor p) where
+ liftCompare2 f g (WrapBifunctor x) (WrapBifunctor y) = liftCompare2 f g x y
+
+instance (Read2 p, Read a) => Read1 (WrappedBifunctor p a) where
+ liftReadsPrec = liftReadsPrec2 readsPrec readList
+instance Read2 p => Read2 (WrappedBifunctor p) where
+ liftReadsPrec2 rp1 rl1 rp2 rl2 p = readParen (p > 10) $ \s0 -> do
+ ("WrapBifunctor", s1) <- lex s0
+ ("{", s2) <- lex s1
+ ("unwrapBifunctor", s3) <- lex s2
+ (x, s4) <- liftReadsPrec2 rp1 rl1 rp2 rl2 0 s3
+ ("}", s5) <- lex s4
+ return (WrapBifunctor x, s5)
+
+instance (Show2 p, Show a) => Show1 (WrappedBifunctor p a) where
+ liftShowsPrec = liftShowsPrec2 showsPrec showList
+instance Show2 p => Show2 (WrappedBifunctor p) where
+ liftShowsPrec2 sp1 sl1 sp2 sl2 p (WrapBifunctor x) = showParen (p > 10) $
+ showString "WrapBifunctor {unwrapBifunctor = "
+ . liftShowsPrec2 sp1 sl1 sp2 sl2 0 x
+ . showChar '}'
+#endif
+
instance Bifunctor p => Bifunctor (WrappedBifunctor p) where
first f = WrapBifunctor . first f . unwrapBifunctor
{-# INLINE first #-}