Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package ghc-reflection for openSUSE:Factory 
checked in at 2023-04-04 21:22:42
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-reflection (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-reflection.new.19717 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-reflection"

Tue Apr  4 21:22:42 2023 rev:13 rq:1076012 version:2.1.7

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-reflection/ghc-reflection.changes    
2022-02-15 23:57:57.800325682 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-reflection.new.19717/ghc-reflection.changes 
2023-04-04 21:22:51.426024896 +0200
@@ -1,0 +2,14 @@
+Thu Mar 30 17:08:02 UTC 2023 - Peter Simons <psim...@suse.com>
+
+- Updated spec file to conform with ghc-rpm-macros-2.5.2.
+
+-------------------------------------------------------------------
+Tue Feb 28 12:10:22 UTC 2023 - Peter Simons <psim...@suse.com>
+
+- Update reflection to version 2.1.7.
+  # 2.1.7 [2023.02.28]
+  * When building with `base-4.18` (GHC 9.6) or later, implement `reifyNat` and
+    `reifySymbol` using the API provided by `GHC.TypeLits` instead of resorting
+    to `unsafeCoerce`.
+
+-------------------------------------------------------------------

Old:
----
  reflection-2.1.6.tar.gz
  reflection.cabal

New:
----
  reflection-2.1.7.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ghc-reflection.spec ++++++
--- /var/tmp/diff_new_pack.SULecH/_old  2023-04-04 21:22:52.162029063 +0200
+++ /var/tmp/diff_new_pack.SULecH/_new  2023-04-04 21:22:52.174029132 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package ghc-reflection
 #
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,23 +17,29 @@
 
 
 %global pkg_name reflection
+%global pkgver %{pkg_name}-%{version}
 %bcond_with tests
 Name:           ghc-%{pkg_name}
-Version:        2.1.6
+Version:        2.1.7
 Release:        0
 Summary:        Reifies arbitrary terms into types that can be reflected back 
into terms
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{pkg_name}
 Source0:        
https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
-Source1:        
https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/1.cabal#/%{pkg_name}.cabal
 BuildRequires:  ghc-Cabal-devel
+BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-template-haskell-devel
+BuildRequires:  ghc-template-haskell-prof
 ExcludeArch:    %{ix86}
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
+BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-containers-devel
+BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-hspec-devel
+BuildRequires:  ghc-hspec-prof
 %endif
 
 %description
@@ -47,11 +53,17 @@
 Shan (<http://okmij.org/ftp/Haskell/tr-15-04.pdf original paper>).
 However, the API has been streamlined to improve performance.
 
-Austin Seipp's tutorial
+There are a handful of tutorials on how to use this library:
+
+* Austin Seipp's tutorial
 <https://www.schoolofhaskell.com/user/thoughtpolice/using-reflection Reflecting
 values to types and back> provides a summary of the approach taken by this
 library, along with more motivating examples.
 
+* Arnaud Spiwack's tutorial
+<https://www.tweag.io/posts/2017-12-21-reflection-tutorial.html All about
+reflection> explains how to use this library.
+
 %package devel
 Summary:        Haskell %{pkg_name} library development files
 Requires:       %{name} = %{version}-%{release}
@@ -62,9 +74,24 @@
 %description devel
 This package provides the Haskell %{pkg_name} library development files.
 
+%package -n ghc-%{pkg_name}-doc
+Summary:        Haskell %{pkg_name} library documentation
+Requires:       ghc-filesystem
+BuildArch:      noarch
+
+%description -n ghc-%{pkg_name}-doc
+This package provides the Haskell %{pkg_name} library documentation.
+
+%package -n ghc-%{pkg_name}-prof
+Summary:        Haskell %{pkg_name} profiling library
+Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
+Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+
+%description -n ghc-%{pkg_name}-prof
+This package provides the Haskell %{pkg_name} profiling library.
+
 %prep
 %autosetup -n %{pkg_name}-%{version}
-cp -p %{SOURCE1} %{pkg_name}.cabal
 find . -type f -exec chmod -x {} +
 
 %build
@@ -88,4 +115,9 @@
 %files devel -f %{name}-devel.files
 %doc CHANGELOG.markdown README.markdown examples
 
+%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%license LICENSE
+
+%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+
 %changelog

++++++ reflection-2.1.6.tar.gz -> reflection-2.1.7.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/reflection-2.1.6/.hlint.yaml 
new/reflection-2.1.7/.hlint.yaml
--- old/reflection-2.1.6/.hlint.yaml    1970-01-01 01:00:00.000000000 +0100
+++ new/reflection-2.1.7/.hlint.yaml    2001-09-09 03:46:40.000000000 +0200
@@ -0,0 +1,2 @@
+- ignore: {name: Unused LANGUAGE pragma}
+- ignore: {name: Avoid lambda}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/reflection-2.1.6/.travis.yml 
new/reflection-2.1.7/.travis.yml
--- old/reflection-2.1.6/.travis.yml    2001-09-09 03:46:40.000000000 +0200
+++ new/reflection-2.1.7/.travis.yml    1970-01-01 01:00:00.000000000 +0100
@@ -1,177 +0,0 @@
-# This Travis job script has been generated by a script via
-#
-#   haskell-ci '--output=.travis.yml' '--config=cabal.haskell-ci' 
'cabal.project'
-#
-# To regenerate the script (for example after adjusting tested-with) run
-#
-#   haskell-ci regenerate
-#
-# For more information, see https://github.com/haskell-CI/haskell-ci
-#
-# version: 0.10
-#
-version: ~> 1.0
-language: c
-os: linux
-dist: xenial
-git:
-  # whether to recursively clone submodules
-  submodules: false
-notifications:
-  irc:
-    channels:
-      - irc.freenode.org#haskell-lens
-    skip_join: true
-    template:
-      - "\x0313reflection\x03/\x0306%{branch}\x03 \x0314%{commit}\x03 
%{build_url} %{message}"
-cache:
-  directories:
-    - $HOME/.cabal/packages
-    - $HOME/.cabal/store
-    - $HOME/.hlint
-before_cache:
-  - rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log
-  # remove files that are regenerated by 'cabal update'
-  - 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.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.2"]}}
-      os: linux
-    - compiler: ghc-8.8.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-8.8.3","cabal-install-3.2"]}}
-      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.2"]}}
-      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.2"]}}
-      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.2"]}}
-      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.2"]}}
-      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.2"]}}
-      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.2"]}}
-      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.2"]}}
-      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.2"]}}
-      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.2"]}}
-      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.2"]}}
-      os: linux
-  allow_failures:
-    - compiler: ghc-7.0.4
-    - compiler: ghc-7.2.2
-before_install:
-  - HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')
-  - WITHCOMPILER="-w $HC"
-  - HADDOCK=$(echo "/opt/$CC/bin/haddock" | sed 's/-/\//')
-  - HCPKG="$HC-pkg"
-  - unset CC
-  - 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"
-  - set -o pipefail
-  - TEST=--enable-tests
-  - BENCH=--enable-benchmarks
-  - HEADHACKAGE=false
-  - 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
-install:
-  - ${CABAL} --version
-  - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> 
/dev/null || echo '?')]"
-  - "echo 'jobs: 2' >> $CABALHOME/config"
-  - |
-    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
-    if [ $HCNUMVER -ge 71000 ] ; then echo "packages: ./examples" >> 
cabal.project ; fi
-  - |
-  - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 
's/-[^-]*$//' | (grep -vE -- '^(reflection|reflection-examples)$' || 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
-  - if [ -f "./examples/configure.ac" ]; then (cd "./examples" && autoreconf 
-i); fi
-  - ${CABAL} v2-freeze $WITHCOMPILER ${TEST} ${BENCH}
-  - "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 
's/any.//'"
-  - rm  cabal.project.freeze
-script:
-  - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
-  # Packaging...
-  - ${CABAL} v2-sdist all
-  # Unpacking...
-  - mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
-  - cd ${DISTDIR} || false
-  - find . -maxdepth 1 -type f -name '*.tar.gz' -exec tar -xvf '{}' \;
-  - find . -maxdepth 1 -type f -name '*.tar.gz' -exec rm       '{}' \;
-  - PKGDIR_reflection="$(find . -maxdepth 1 -type d -regex 
'.*/reflection-[0-9.]*')"
-  - PKGDIR_reflection_examples="$(find . -maxdepth 1 -type d -regex 
'.*/reflection-examples-[0-9.]*')"
-  # Generate cabal.project
-  - rm -rf cabal.project cabal.project.local cabal.project.freeze
-  - touch cabal.project
-  - |
-    echo "packages: ${PKGDIR_reflection}" >> cabal.project
-    if [ $HCNUMVER -ge 71000 ] ; then echo "packages: 
${PKGDIR_reflection_examples}" >> cabal.project ; fi
-  - |
-  - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 
's/-[^-]*$//' | (grep -vE -- '^(reflection|reflection-examples)$' || 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} v2-build $WITHCOMPILER ${TEST} ${BENCH} all
-  # Testing...
-  - ${CABAL} v2-test $WITHCOMPILER ${TEST} ${BENCH} all
-  # cabal check...
-  - (cd ${PKGDIR_reflection} && ${CABAL} -vnormal check)
-  - if [ $HCNUMVER -ge 71000 ] ; then (cd ${PKGDIR_reflection_examples} && 
${CABAL} -vnormal check) ; fi
-  # haddock...
-  - ${CABAL} v2-haddock $WITHCOMPILER --with-haddock $HADDOCK ${TEST} ${BENCH} 
all
-  # Building without installed constraints for packages in global-db...
-  - rm -f cabal.project.local
-  - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all
-
-# REGENDATA 
("0.10",["--output=.travis.yml","--config=cabal.haskell-ci","cabal.project"])
-# EOF
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/reflection-2.1.6/CHANGELOG.markdown 
new/reflection-2.1.7/CHANGELOG.markdown
--- old/reflection-2.1.6/CHANGELOG.markdown     2001-09-09 03:46:40.000000000 
+0200
+++ new/reflection-2.1.7/CHANGELOG.markdown     2001-09-09 03:46:40.000000000 
+0200
@@ -1,3 +1,8 @@
+# 2.1.7 [2023.02.28]
+* When building with `base-4.18` (GHC 9.6) or later, implement `reifyNat` and
+  `reifySymbol` using the API provided by `GHC.TypeLits` instead of resorting
+  to `unsafeCoerce`.
+
 # 2.1.6 [2020.05.16]
 * Fix a bug in which `give` (and possibly `reify`, `reifyNat`, and
   `reifySymbol`) could be unsoundly inlined by GHC 8.10 or older to produce
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/reflection-2.1.6/README.markdown 
new/reflection-2.1.7/README.markdown
--- old/reflection-2.1.6/README.markdown        2001-09-09 03:46:40.000000000 
+0200
+++ new/reflection-2.1.7/README.markdown        2001-09-09 03:46:40.000000000 
+0200
@@ -1,7 +1,7 @@
 reflection
 ==========
 
-[![Hackage](https://img.shields.io/hackage/v/reflection.svg)](https://hackage.haskell.org/package/reflection)
 [![Build 
Status](https://secure.travis-ci.org/ekmett/reflection.png?branch=master)](http://travis-ci.org/ekmett/reflection)
+[![Hackage](https://img.shields.io/hackage/v/reflection.svg)](https://hackage.haskell.org/package/reflection)
 [![Build 
Status](https://github.com/ekmett/reflection/workflows/Haskell-CI/badge.svg)](https://github.com/ekmett/reflection/actions?query=workflow%3AHaskell-CI)
 
 This package provides an implementation of the ideas presented in [Functional 
Pearl: Implicit Configurations](http://okmij.org/ftp/Haskell/tr-15-04.pdf) by 
Oleg Kiselyov and Chung-Chieh Shan. However, the API has been implemented in a 
much more efficient manner.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/reflection-2.1.6/examples/Constraints.hs 
new/reflection-2.1.7/examples/Constraints.hs
--- old/reflection-2.1.6/examples/Constraints.hs        2001-09-09 
03:46:40.000000000 +0200
+++ new/reflection-2.1.7/examples/Constraints.hs        2001-09-09 
03:46:40.000000000 +0200
@@ -1,7 +1,7 @@
 {-# LANGUAGE Rank2Types, TypeFamilies, TypeOperators, ConstraintKinds, 
PolyKinds, FlexibleInstances, MultiParamTypeClasses, ScopedTypeVariables, 
FlexibleContexts, UndecidableInstances, CPP #-}
 module Constraints where
 
-import Control.Newtype          -- from newtype
+import Control.Newtype.Generics -- from newtype-generics
 import Data.Constraint          -- from constraints
 import Data.Constraint.Unsafe   -- from constraints
 import Data.Proxy               -- from tagged
@@ -17,7 +17,8 @@
   data Def (p :: * -> Constraint) (a :: *)
   reifiedIns :: Reifies s (Def p a) :- p (Lift p a s)
 
-instance Newtype (Lift p a s) a where
+instance Newtype (Lift p a s) where
+  type O (Lift p a s) = a
   pack = Lift
   unpack = lower
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/reflection-2.1.6/examples/FromJSON.hs 
new/reflection-2.1.7/examples/FromJSON.hs
--- old/reflection-2.1.6/examples/FromJSON.hs   2001-09-09 03:46:40.000000000 
+0200
+++ new/reflection-2.1.7/examples/FromJSON.hs   2001-09-09 03:46:40.000000000 
+0200
@@ -11,6 +11,9 @@
 {-# LANGUAGE OverloadedStrings #-}
 
 import Data.Aeson             -- from aeson
+#if MIN_VERSION_aeson(2,0,0)
+import qualified Data.Aeson.Key as Key
+#endif
 import Data.Aeson.Types (Parser)
 import Data.Proxy             -- from tagged
 import Data.Reflection        -- from reflection
@@ -33,7 +36,15 @@
 
 fooParser :: Text -> Object -> Parser Foo
 fooParser prefix o = do
-    Foo <$> o .: (prefix <> "field1") <*> o .: (prefix <> "field2")
+    Foo <$> o .: (toKey prefix <> "field1") <*> o .: (toKey prefix <> "field2")
+
+#if MIN_VERSION_aeson(2,0,0)
+toKey :: Text -> Key.Key
+toKey = Key.fromText
+#else
+toKey :: Text -> Text
+toKey = id
+#endif
 
 -- A wrapper over Foo carrying a phantom type s
 newtype J a s = J { runJ :: a }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/reflection-2.1.6/examples/ReaderLike.hs 
new/reflection-2.1.7/examples/ReaderLike.hs
--- old/reflection-2.1.6/examples/ReaderLike.hs 2001-09-09 03:46:40.000000000 
+0200
+++ new/reflection-2.1.7/examples/ReaderLike.hs 2001-09-09 03:46:40.000000000 
+0200
@@ -65,4 +65,6 @@
     where conf = reflect (Proxy :: Proxy p)
   abs = undefined
   signum = undefined
+  (-) = undefined
+  negate = undefined
   fromInteger = Datum
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/reflection-2.1.6/examples/reflection-examples.cabal 
new/reflection-2.1.7/examples/reflection-examples.cabal
--- old/reflection-2.1.6/examples/reflection-examples.cabal     2001-09-09 
03:46:40.000000000 +0200
+++ new/reflection-2.1.7/examples/reflection-examples.cabal     2001-09-09 
03:46:40.000000000 +0200
@@ -15,13 +15,16 @@
                 2004 Oleg Kiselyov and Chung-chieh Shan
 build-type:     Simple
 cabal-version:  >= 1.10
-tested-with:   GHC == 7.10.3
-             , GHC == 8.0.2
+tested-with:   GHC == 8.0.2
              , GHC == 8.2.2
              , GHC == 8.4.4
              , GHC == 8.6.5
-             , GHC == 8.8.3
-             , GHC == 8.10.1
+             , GHC == 8.8.4
+             , GHC == 8.10.7
+             , GHC == 9.0.2
+             , GHC == 9.2.6
+             , GHC == 9.4.4
+             , GHC == 9.6.1
 
 flag examples
   default: True
@@ -31,22 +34,27 @@
     buildable:         False
   exposed-modules:     Constraints
                        Monoid
-  build-depends:       base >= 4.8 && < 5,
+  build-depends:       base >= 4.9 && < 5,
                        constraints,
-                       newtype,
+                       newtype-generics >= 0.5.3,
                        reflection,
                        semigroups,
                        tagged
   hs-source-dirs:      .
   ghc-options:         -Wall
+  if impl(ghc >= 8.6)
+    ghc-options:       -Wno-star-is-type
   default-language:    Haskell2010
 
 executable reflection-from-json
   if !flag(examples)
     buildable:         False
   main-is:             FromJSON.hs
-  build-depends:       aeson,
-                       base >= 4.8 && < 5,
+  build-depends:
+                       -- TODO: Eventually, we should bump the lower version
+                       -- bounds to >=2 so that we can remove some CPP in 
FromJSON.
+                       aeson >= 1 && < 2.2,
+                       base >= 4.9 && < 5,
                        microlens,
                        microlens-aeson,
                        reflection,
@@ -61,10 +69,12 @@
   if !flag(examples)
     buildable:         False
   main-is:             ReaderLike.hs
-  build-depends:       base >= 4.8 && < 5,
+  build-depends:       base >= 4.9 && < 5,
                        reflection,
                        tagged
   hs-source-dirs:      .
   ghc-options:         -Wall -threaded -rtsopts
+  if impl(ghc >= 8.6)
+    ghc-options:       -Wno-star-is-type
   default-language:    Haskell2010
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/reflection-2.1.6/fast/Data/Reflection.hs 
new/reflection-2.1.7/fast/Data/Reflection.hs
--- old/reflection-2.1.6/fast/Data/Reflection.hs        2001-09-09 
03:46:40.000000000 +0200
+++ new/reflection-2.1.7/fast/Data/Reflection.hs        2001-09-09 
03:46:40.000000000 +0200
@@ -134,7 +134,7 @@
 #if (__GLASGOW_HASKELL__ >= 707) || (defined(MIN_VERSION_template_haskell) && 
USE_TYPE_LITS)
 import GHC.TypeLits
 # if MIN_VERSION_base(4,10,0)
-import Numeric.Natural (Natural)
+import qualified Numeric.Natural as Numeric (Natural)
 # elif __GLASGOW_HASKELL__ >= 707
 import Control.Exception (ArithException(..), throw)
 # endif
@@ -154,8 +154,12 @@
 import Unsafe.Coerce
 #endif
 
-#ifdef HLINT
-{-# ANN module "HLint: ignore Avoid lambda" #-}
+#if MIN_VERSION_base(4,7,0)
+import Data.Coerce (Coercible, coerce)
+#endif
+
+#if MIN_VERSION_base(4,18,0)
+import qualified GHC.TypeNats as TN
 #endif
 
 -- Due to https://gitlab.haskell.org/ghc/ghc/issues/16893, inlining
@@ -199,8 +203,6 @@
 -- KnownNat
 
--------------------------------------------------------------------------------
 
-newtype MagicNat r = MagicNat (forall (n :: Nat). KnownNat n => Proxy n -> r)
-
 -- | This upgraded version of 'reify' can be used to generate a 'KnownNat' 
suitable for use with other APIs.
 --
 -- Attemping to pass a negative 'Integer' as an argument will result in an
@@ -208,6 +210,8 @@
 --
 -- /Available only on GHC 7.8+/
 --
+-- >>> import GHC.TypeLits
+--
 -- >>> reifyNat 4 natVal
 -- 4
 --
@@ -215,37 +219,58 @@
 -- 4
 
 reifyNat :: forall r. Integer -> (forall (n :: Nat). KnownNat n => Proxy n -> 
r) -> r
+# if MIN_VERSION_base(4,18,0)
+-- With base-4.18 or later, we can use the API in GHC.TypeNats to define this
+-- function directly.
+reifyNat n k = TN.withSomeSNat (fromInteger n :: Numeric.Natural) $
+               \(sn :: (SNat n)) -> TN.withKnownNat sn $ k (Proxy :: Proxy n)
+{-# INLINE reifyNat #-}
+# else
+-- On older versions of base, we resort to unsafeCoerce.
 reifyNat n k = unsafeCoerce (MagicNat k :: MagicNat r)
-# if MIN_VERSION_base(4,10,0)
+#  if MIN_VERSION_base(4,10,0)
                              -- Starting with base-4.10, the internal
                              -- representation of KnownNat changed from Integer
                              -- to Natural, so make sure to perform the same
                              -- conversion before unsafeCoercing.
-                             (fromInteger n :: Natural)
-# else
+                             (fromInteger n :: Numeric.Natural)
+#  else
                              (if n < 0 then throw Underflow else n)
-# endif
+#  endif
                              Proxy
 {-# INLINE_UNSAFE_COERCE reifyNat #-}
 
+newtype MagicNat r = MagicNat (forall (n :: Nat). KnownNat n => Proxy n -> r)
+# endif
+
 
--------------------------------------------------------------------------------
 -- KnownSymbol
 
--------------------------------------------------------------------------------
 
-newtype MagicSymbol r = MagicSymbol (forall (n :: Symbol). KnownSymbol n => 
Proxy n -> r)
-
 -- | This upgraded version of 'reify' can be used to generate a 'KnownSymbol' 
suitable for use with other APIs.
 --
 -- /Available only on GHC 7.8+/
 --
+-- >>> import GHC.TypeLits
+--
 -- >>> reifySymbol "hello" symbolVal
 -- "hello"
 --
 -- >>> reifySymbol "hello" reflect
 -- "hello"
 reifySymbol :: forall r. String -> (forall (n :: Symbol). KnownSymbol n => 
Proxy n -> r) -> r
+# if MIN_VERSION_base(4,18,0)
+-- With base-4.18 or later, we can use the API in GHC.TypeNats to define this
+-- function directly.
+reifySymbol s k = withSomeSSymbol s $ \(ss :: SSymbol s) -> withKnownSymbol ss 
(k (Proxy :: Proxy s))
+{-# INLINE reifySymbol #-}
+# else
+-- On older versions of base, we resort to unsafeCoerce.
 reifySymbol n k = unsafeCoerce (MagicSymbol k :: MagicSymbol r) n Proxy
 {-# INLINE_UNSAFE_COERCE reifySymbol #-}
+# endif
+
+newtype MagicSymbol r = MagicSymbol (forall (n :: Symbol). KnownSymbol n => 
Proxy n -> r)
 #endif
 
 ------------------------------------------------------------------------------
@@ -664,5 +689,10 @@
 sequenceBy :: Traversable t => (forall x. x -> f x) -> (forall x y. f (x -> y) 
-> f x -> f y) -> t (f a) -> f (t a)
 sequenceBy pur app = reifyApplicative pur app (traverse ReflectedApplicative)
 
+#if MIN_VERSION_base(4,7,0)
+(#.) :: Coercible c b => (b -> c) -> (a -> b) -> (a -> c)
+(#.) _ = coerce (\x -> x :: b) :: forall a b. Coercible b a => a -> b
+#else
 (#.) :: (b -> c) -> (a -> b) -> a -> c
 (#.) _ = unsafeCoerce
+#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/reflection-2.1.6/reflection.cabal 
new/reflection-2.1.7/reflection.cabal
--- old/reflection-2.1.6/reflection.cabal       2001-09-09 03:46:40.000000000 
+0200
+++ new/reflection-2.1.7/reflection.cabal       2001-09-09 03:46:40.000000000 
+0200
@@ -1,5 +1,5 @@
 name:           reflection
-version:        2.1.6
+version:        2.1.7
 license:        BSD3
 license-file:   LICENSE
 author:         Edward A. Kmett, Elliott Hird, Oleg Kiselyov and Chung-chieh 
Shan
@@ -25,8 +25,12 @@
   and Chung-chieh Shan (<http://okmij.org/ftp/Haskell/tr-15-04.pdf original 
paper>).
   However, the API has been streamlined to improve performance.
   .
-  Austin Seipp's tutorial 
<https://www.schoolofhaskell.com/user/thoughtpolice/using-reflection Reflecting 
values to types and back> provides a summary of the
+  There are a handful of tutorials on how to use this library:
+  .
+  * Austin Seipp's tutorial 
<https://www.schoolofhaskell.com/user/thoughtpolice/using-reflection Reflecting 
values to types and back> provides a summary of the
   approach taken by this library, along with more motivating examples.
+  .
+  * Arnaud Spiwack's tutorial 
<https://www.tweag.io/posts/2017-12-21-reflection-tutorial.html All about 
reflection> explains how to use this library.
 tested-with:   GHC == 7.0.4
              , GHC == 7.2.2
              , GHC == 7.4.2
@@ -37,10 +41,15 @@
              , GHC == 8.2.2
              , GHC == 8.4.4
              , GHC == 8.6.5
-             , GHC == 8.8.3
-             , GHC == 8.10.1
+             , GHC == 8.8.4
+             , GHC == 8.10.7
+             , GHC == 9.0.2
+             , GHC == 9.2.6
+             , GHC == 9.4.4
+             , GHC == 9.6.1
 
 extra-source-files:
+  .hlint.yaml
   examples/reflection-examples.cabal
   examples/LICENSE
   examples/*.hs
@@ -48,7 +57,6 @@
   README.markdown
   slow/Data/Reflection.hs
   fast/Data/Reflection.hs
-  .travis.yml
 
 flag slow
   description:
@@ -70,6 +78,8 @@
 
 library
   ghc-options: -Wall
+  if impl(ghc >= 8.6)
+    ghc-options: -Wno-star-is-type
 
   if impl(ghc >= 7.2)
     default-extensions: Trustworthy
@@ -83,7 +93,7 @@
 
   if !impl(ghc >= 8.0)
     build-depends:
-      semigroups >= 0.11 && < 0.20
+      semigroups >= 0.11 && < 0.21
 
   default-language: Haskell98
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/reflection-2.1.6/tests/ReifyNatSpec.hs 
new/reflection-2.1.7/tests/ReifyNatSpec.hs
--- old/reflection-2.1.6/tests/ReifyNatSpec.hs  2001-09-09 03:46:40.000000000 
+0200
+++ new/reflection-2.1.7/tests/ReifyNatSpec.hs  2001-09-09 03:46:40.000000000 
+0200
@@ -3,15 +3,19 @@
 module ReifyNatSpec where
 
 #if __GLASGOW_HASKELL__ >= 708
-import Control.Exception (ArithException(..), evaluate)
 import Data.Reflection
 import Test.Hspec.QuickCheck
-import Test.QuickCheck (Negative(..), NonNegative(..))
+import Test.QuickCheck (NonNegative(..))
 
 # if MIN_VERSION_base(4,10,0)
 import GHC.TypeNats (natVal)
 import Numeric.Natural (Natural)
 # endif
+
+# if __GLASGOW_HASKELL__ != 900
+import Control.Exception (ArithException(..), evaluate)
+import Test.QuickCheck (Negative(..))
+# endif
 #endif
 
 import Test.Hspec
@@ -25,9 +29,16 @@
   describe "reifyNat" $ do
     prop "reify positive Integers and reflect them back" $
       \(NonNegative (i :: Integer)) -> reifyNat i $ \p -> reflect p `shouldBe` 
i
+# if __GLASGOW_HASKELL__ != 900
+    -- Inexplicably, this test fails on GHC 9.0 with hspec-2.8.4 or later.
+    -- Moreover, I suspect that undefined behavior is involved in some way,
+    -- as the output of hspec will occasionally be swallowed entirely. I have
+    -- not been able to observe this phenomenon on any other version of GHC,
+    -- so I will simply disable this test on 9.0.
     prop "should throw an Underflow exception on negative inputs" $
       \(Negative (i :: Integer)) ->
         reifyNat i (evaluate . reflect) `shouldThrow` (== Underflow)
+# endif
 # if MIN_VERSION_base(4,10,0)
     it "should reflect very large Naturals correctly" $ do -- #41
       let d42, d2_63, d2_64 :: Natural

Reply via email to