Hello community, here is the log from the commit of package ghc-profunctors for openSUSE:Factory checked in at 2018-07-24 17:24:06 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-profunctors (Old) and /work/SRC/openSUSE:Factory/.ghc-profunctors.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-profunctors" Tue Jul 24 17:24:06 2018 rev:8 rq:624316 version:5.3 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-profunctors/ghc-profunctors.changes 2018-05-30 12:26:52.267179627 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-profunctors.new/ghc-profunctors.changes 2018-07-24 17:24:06.947432624 +0200 @@ -1,0 +2,28 @@ +Wed Jul 18 14:26:37 UTC 2018 - [email protected] + +- Cosmetic: replace tabs with blanks, strip trailing white space, + and update copyright headers with spec-cleaner. + +------------------------------------------------------------------- +Fri Jul 13 14:31:49 UTC 2018 - [email protected] + +- Update profunctors to version 5.3. + 5.3 [2018.07.02] + ---------------- + * Generalize the types of `(#.)` and `(.#)`. Before, they were: + + ```haskell + (#.) :: (Profunctor p, Coercible c b) => (b -> c) -> p a b -> p a c + (.#) :: (Profunctor p, Coercible b a) => p b c -> (a -> b) -> p a c + ``` + + Now, they are: + + ```haskell + (#.) :: (Profunctor p, Coercible c b) => q b c -> p a b -> p a c + (.#) :: (Profunctor p, Coercible b a) => p b c -> q a b -> p a c + ``` + * Drop support for GHC < 7.8. + * Add a `Profunctor` instance for `Data.Bifunctor.Sum`. + +------------------------------------------------------------------- @@ -43 +70,0 @@ - @@ -64 +90,0 @@ - Old: ---- profunctors-5.2.2.tar.gz profunctors.cabal New: ---- profunctors-5.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-profunctors.spec ++++++ --- /var/tmp/diff_new_pack.UFDaSK/_old 2018-07-24 17:24:07.491433318 +0200 +++ /var/tmp/diff_new_pack.UFDaSK/_new 2018-07-24 17:24:07.491433318 +0200 @@ -18,14 +18,13 @@ %global pkg_name profunctors Name: ghc-%{pkg_name} -Version: 5.2.2 +Version: 5.3 Release: 0 Summary: Profunctors License: BSD-3-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 -Source1: https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/1.cabal#/%{pkg_name}.cabal BuildRequires: ghc-Cabal-devel BuildRequires: ghc-base-orphans-devel BuildRequires: ghc-bifunctors-devel @@ -53,7 +52,6 @@ %prep %setup -q -n %{pkg_name}-%{version} -cp -p %{SOURCE1} %{pkg_name}.cabal %build %ghc_lib_build ++++++ profunctors-5.2.2.tar.gz -> profunctors-5.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/profunctors-5.2.2/.hlint.yaml new/profunctors-5.3/.hlint.yaml --- old/profunctors-5.2.2/.hlint.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/profunctors-5.3/.hlint.yaml 2018-07-03 03:33:59.000000000 +0200 @@ -0,0 +1,54 @@ +- extensions: + - default: false # all extension are banned by default + - name: + - CPP + - DeriveFunctor + - FlexibleContexts + - FlexibleInstances + - FunctionalDependencies + - GADTs + - InstanceSigs + - MultiParamTypeClasses + - RankNTypes + - ScopedTypeVariables + - Trustworthy + - TypeOperators + - TypeFamilies + - UndecidableInstances + +- functions: + - {name: unsafeCoerce, within: []} # banned + +- ignore: + name: Use const + within: + - Data.Profunctor.Types + +- ignore: + name: Avoid lambda + within: + - Data.Profunctor.Choice + - Data.Profunctor.Traversing + +- ignore: + name: Use fmap + within: + - Data.Profunctor.Composition + - Data.Profunctor.Strong + - Data.Profunctor.Unsafe + +- ignore: + name: Avoid lambda + within: Data.Profunctor.Strong + +- ignore: + name: Redundant lambda + within: Data.Profunctor.Unsafe + +- ignore: + name: Collapse lambdas + within: Data.Profunctor.Unsafe + +- fixity: "infixr 9 #." +- fixity: "infixl 8 .#" +- fixity: "infixr 0 :->" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/profunctors-5.2.2/.travis.yml new/profunctors-5.3/.travis.yml --- old/profunctors-5.2.2/.travis.yml 2018-01-18 21:05:00.000000000 +0100 +++ new/profunctors-5.3/.travis.yml 2018-07-03 03:33:59.000000000 +0200 @@ -1,6 +1,6 @@ # This Travis job script has been generated by a script via # -# runghc make_travis_yml_2.hs '-o' '.travis.yml' '--irc-channel=irc.freenode.org#haskell-lens' '--no-no-tests-no-bench' '--no-installed' 'cabal.project' +# 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' # # For more information, see https://github.com/hvr/multi-ghc-travis # @@ -34,58 +34,44 @@ - rm -rfv $HOME/.cabal/packages/head.hackage -addons: - apt: - packages: &apt_packages - - ghc-ppa-tools - - hlint - matrix: include: - - compiler: "ghc-7.0.4" - # env: TEST=--disable-tests BENCH=--disable-benchmarks - addons: {apt: {packages: [*apt_packages,cabal-install-2.0,ghc-7.0.4], sources: [hvr-ghc]}} - - compiler: "ghc-7.2.2" - # env: TEST=--disable-tests BENCH=--disable-benchmarks - addons: {apt: {packages: [*apt_packages,cabal-install-2.0,ghc-7.2.2], sources: [hvr-ghc]}} - - compiler: "ghc-7.4.2" + - 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: [*apt_packages,cabal-install-2.0,ghc-7.4.2], sources: [hvr-ghc]}} - - compiler: "ghc-7.6.3" + 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: [*apt_packages,cabal-install-2.0,ghc-7.6.3], sources: [hvr-ghc]}} - - compiler: "ghc-7.8.4" + 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: [*apt_packages,cabal-install-2.0,ghc-7.8.4], sources: [hvr-ghc]}} + 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: [*apt_packages,cabal-install-2.0,ghc-7.10.3], sources: [hvr-ghc]}} - - compiler: "ghc-8.0.2" - # env: TEST=--disable-tests BENCH=--disable-benchmarks - addons: {apt: {packages: [*apt_packages,cabal-install-2.0,ghc-8.0.2], sources: [hvr-ghc]}} - - compiler: "ghc-8.2.2" + 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: [*apt_packages,cabal-install-2.0,ghc-8.2.2], sources: [hvr-ghc]}} - - compiler: "ghc-8.4.1" - env: GHCHEAD=true - addons: {apt: {packages: [*apt_packages,cabal-install-head,ghc-8.4.1], sources: [hvr-ghc]}} + addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.8.4], sources: [hvr-ghc]}} - compiler: "ghc-head" env: GHCHEAD=true - addons: {apt: {packages: [*apt_packages,cabal-install-head,ghc-head], sources: [hvr-ghc]}} + addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-head], sources: [hvr-ghc]}} allow_failures: - - compiler: "ghc-7.0.4" - - compiler: "ghc-7.2.2" - - compiler: "ghc-8.4.1" - compiler: "ghc-head" + - compiler: "ghc-8.6.1" before_install: - HC=${CC} - HCPKG=${HC/ghc/ghc-pkg} - unset CC + - export HLINTVER=2.1.3 + - mkdir ~/.hlint + - curl -L https://github.com/ndmitchell/hlint/releases/download/v$HLINTVER/hlint-$HLINTVER-x86_64-linux.tar.gz | tar -xz --strip-components=1 -C ~/.hlint - ROOTDIR=$(pwd) - mkdir -p $HOME/.local/bin - - "PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$HOME/local/bin:$PATH" + - "PATH=~/.hlint:/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/') )) - echo $HCNUMVER @@ -95,7 +81,8 @@ - BENCH=${BENCH---enable-benchmarks} - TEST=${TEST---enable-tests} - HADDOCK=${HADDOCK-true} - - INSTALLED=${INSTALLED-true} + - UNCONSTRAINED=${UNCONSTRAINED-true} + - NOINSTALLEDCONSTRAINTS=${NOINSTALLEDCONSTRAINTS-false} - GHCHEAD=${GHCHEAD-false} - travis_retry cabal update -v - "sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config" @@ -103,7 +90,8 @@ # Overlay Hackage Package Index for GHC HEAD: https://github.com/hvr/head.hackage - | if $GHCHEAD; then - sed -i.bak 's/-- allow-newer:.*/allow-newer: *:base, *:template-haskell, *:ghc, *:Cabal/' ${HOME}/.cabal/config + 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 @@ -113,17 +101,22 @@ 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 fi - grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$' - "printf 'packages: \".\"\\n' > cabal.project" - - cat 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" + - 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 + - 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; @@ -135,8 +128,10 @@ - cd ${DISTDIR} || false - find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \; - "printf 'packages: profunctors-*/*.cabal\\n' > cabal.project" - - cat 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" + - cat cabal.project || true + - cat cabal.project.local || true # build & run tests, build benchmarks - cabal new-build -w ${HC} ${TEST} ${BENCH} all @@ -149,7 +144,8 @@ - if $HADDOCK; then cabal new-haddock -w ${HC} ${TEST} ${BENCH} all; else echo "Skipping haddock generation";fi # hlint - - (cd profunctors-* && hlint src --cpp-define=HLINT) + - hlint --version + - (cd profunctors-* && hlint src) -# REGENDATA ["-o",".travis.yml","--irc-channel=irc.freenode.org#haskell-lens","--no-no-tests-no-bench","--no-installed","cabal.project"] +# REGENDATA ["-o",".travis.yml","--ghc-head","--irc-channel=irc.freenode.org#haskell-lens","--no-no-tests-no-bench","--no-unconstrained","cabal.project"] # EOF diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/profunctors-5.2.2/CHANGELOG.markdown new/profunctors-5.3/CHANGELOG.markdown --- old/profunctors-5.2.2/CHANGELOG.markdown 2018-01-18 21:05:00.000000000 +0100 +++ new/profunctors-5.3/CHANGELOG.markdown 2018-07-03 03:33:59.000000000 +0200 @@ -1,3 +1,21 @@ +5.3 [2018.07.02] +---------------- +* Generalize the types of `(#.)` and `(.#)`. Before, they were: + + ```haskell + (#.) :: (Profunctor p, Coercible c b) => (b -> c) -> p a b -> p a c + (.#) :: (Profunctor p, Coercible b a) => p b c -> (a -> b) -> p a c + ``` + + Now, they are: + + ```haskell + (#.) :: (Profunctor p, Coercible c b) => q b c -> p a b -> p a c + (.#) :: (Profunctor p, Coercible b a) => p b c -> q a b -> p a c + ``` +* Drop support for GHC < 7.8. +* Add a `Profunctor` instance for `Data.Bifunctor.Sum`. + 5.2.2 [2018.01.18] ------------------ * Add `Semigroup` instances for `Closure` and `Tambara` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/profunctors-5.2.2/HLint.hs new/profunctors-5.3/HLint.hs --- old/profunctors-5.2.2/HLint.hs 2018-01-18 21:05:00.000000000 +0100 +++ new/profunctors-5.3/HLint.hs 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -ignore "use const" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/profunctors-5.2.2/profunctors.cabal new/profunctors-5.3/profunctors.cabal --- old/profunctors-5.2.2/profunctors.cabal 2018-01-18 21:05:00.000000000 +0100 +++ new/profunctors-5.3/profunctors.cabal 2018-07-03 03:33:59.000000000 +0200 @@ -1,6 +1,6 @@ name: profunctors category: Control, Categories -version: 5.2.2 +version: 5.3 license: BSD3 cabal-version: >= 1.10 license-file: LICENSE @@ -12,16 +12,21 @@ copyright: Copyright (C) 2011-2015 Edward A. Kmett synopsis: Profunctors description: Profunctors. -tested-with: GHC == 7.0.4, GHC == 7.2.2, GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.1 +tested-with: GHC == 7.8.4 + , GHC == 7.10.3 + , GHC == 8.0.2 + , GHC == 8.2.2 + , GHC == 8.4.3 + , GHC == 8.6.1 build-type: Simple extra-source-files: .ghci .gitignore + .hlint.yaml .travis.yml .vim.custom README.markdown CHANGELOG.markdown - HLint.hs source-repository head type: git @@ -29,8 +34,8 @@ library build-depends: - base >= 4 && < 5, - base-orphans >= 0.4 && < 0.7, + base >= 4.7 && < 5, + base-orphans >= 0.4 && < 0.9, bifunctors >= 5.2 && < 6, comonad >= 4 && < 6, contravariant >= 1 && < 2, @@ -58,6 +63,10 @@ Data.Profunctor.Yoneda ghc-options: -Wall -O2 + + if impl(ghc>=8.0) + ghc-options: -Wno-trustworthy-safe + hs-source-dirs: src default-language: Haskell2010 @@ -66,5 +75,6 @@ GADTs FlexibleContexts FlexibleInstances + InstanceSigs UndecidableInstances TypeFamilies diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/profunctors-5.2.2/src/Data/Profunctor/Cayley.hs new/profunctors-5.3/src/Data/Profunctor/Cayley.hs --- old/profunctors-5.2.2/src/Data/Profunctor/Cayley.hs 2018-01-18 21:05:00.000000000 +0100 +++ new/profunctors-5.3/src/Data/Profunctor/Cayley.hs 2018-07-03 03:33:59.000000000 +0200 @@ -1,8 +1,5 @@ -{-# LANGUAGE CPP #-} {-# LANGUAGE RankNTypes #-} -#if __GLASGOW_HASKELL__ >= 702 && __GLASGOW_HASKELL__ <= 708 {-# LANGUAGE Trustworthy #-} -#endif ----------------------------------------------------------------------------- -- | -- Copyright : (C) 2014-2015 Edward Kmett @@ -72,7 +69,7 @@ right = Cayley . fmap right . runCayley Cayley ab +++ Cayley cd = Cayley $ liftA2 (+++) ab cd Cayley ac ||| Cayley bc = Cayley $ liftA2 (|||) ac bc - + instance (Applicative f, ArrowLoop p) => ArrowLoop (Cayley f p) where loop = Cayley . fmap loop . runCayley @@ -86,7 +83,7 @@ mapCayley f (Cayley g) = Cayley (f g) -- instance Adjunction f g => ProfunctorAdjunction (Cayley f) (Cayley g) where - + {- newtype Uncayley p a = Uncayley (p () a) @@ -107,7 +104,7 @@ -- only a true iso for Stronger p and q, no? _Smash :: (Strong p, Closed q) => Iso (Cayley (Uncayley p) (->) a b) - (Cayley (Uncayley q) (->) c d) + (Cayley (Uncayley q) (->) c d) (p a b) (q c d) _Smash = dimap hither (fmap yon) where diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/profunctors-5.2.2/src/Data/Profunctor/Choice.hs new/profunctors-5.3/src/Data/Profunctor/Choice.hs --- old/profunctors-5.2.2/src/Data/Profunctor/Choice.hs 2018-01-18 21:05:00.000000000 +0100 +++ new/profunctors-5.3/src/Data/Profunctor/Choice.hs 2018-07-03 03:33:59.000000000 +0200 @@ -3,9 +3,6 @@ {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE MultiParamTypeClasses #-} -#if __GLASGOW_HASKELL__ >= 702 && __GLASGOW_HASKELL__ <= 708 -{-# LANGUAGE Trustworthy #-} -#endif ----------------------------------------------------------------------------- -- | -- Copyright : (C) 2014-2015 Edward Kmett @@ -103,9 +100,7 @@ right' :: p a b -> p (Either c a) (Either c b) right' = dimap (either Right Left) (either Right Left) . left' -#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 708 {-# MINIMAL left' | right' #-} -#endif instance Choice (->) where left' ab (Left a) = Left (ab a) @@ -336,9 +331,7 @@ unright :: p (Either d a) (Either d b) -> p a b unright = unleft . dimap (either Right Left) (either Right Left) -#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 708 {-# MINIMAL unleft | unright #-} -#endif instance Cochoice (->) where unleft f = go . Left where go = either id (go . Right) . f diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/profunctors-5.2.2/src/Data/Profunctor/Closed.hs new/profunctors-5.3/src/Data/Profunctor/Closed.hs --- old/profunctors-5.2.2/src/Data/Profunctor/Closed.hs 2018-01-18 21:05:00.000000000 +0100 +++ new/profunctors-5.3/src/Data/Profunctor/Closed.hs 2018-07-03 03:33:59.000000000 +0200 @@ -1,16 +1,14 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE GADTs #-} +{-# LANGUAGE InstanceSigs #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE MultiParamTypeClasses #-} - -#if __GLASGOW_HASKELL__ >= 704 && __GLASGOW_HASKELL__ < 708 +{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE Trustworthy #-} -#endif - ----------------------------------------------------------------------------- -- | --- Copyright : (C) 2014-2015 Edward Kmett +-- Copyright : (C) 2014-2018 Edward Kmett -- License : BSD-style (see the file LICENSE) -- -- Maintainer : Edward Kmett <[email protected]> @@ -33,6 +31,7 @@ import Control.Comonad import Data.Bifunctor.Product (Product(..)) import Data.Bifunctor.Tannen (Tannen(..)) +import Data.Coerce (Coercible, coerce) import Data.Distributive import Data.Profunctor.Adjunction import Data.Profunctor.Monad @@ -105,8 +104,12 @@ dimap f g (Closure p) = Closure $ dimap (fmap f) (fmap g) p lmap f (Closure p) = Closure $ lmap (fmap f) p rmap f (Closure p) = Closure $ rmap (fmap f) p - w #. Closure p = Closure $ fmap w #. p - Closure p .# w = Closure $ p .# fmap w + + (#.) :: forall a b c q. Coercible c b => q b c -> Closure p a b -> Closure p a c + _ #. Closure p = Closure $ fmap (coerce (id :: c -> c) :: b -> c) #. p + + (.#) :: forall a b c q. Coercible b a => Closure p b c -> q a b -> Closure p a c + Closure p .# _ = Closure $ p .# fmap (coerce (id :: b -> b) :: a -> b) instance ProfunctorFunctor Closure where promap f (Closure p) = Closure (f p) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/profunctors-5.2.2/src/Data/Profunctor/Composition.hs new/profunctors-5.3/src/Data/Profunctor/Composition.hs --- old/profunctors-5.2.2/src/Data/Profunctor/Composition.hs 2018-01-18 21:05:00.000000000 +0100 +++ new/profunctors-5.3/src/Data/Profunctor/Composition.hs 2018-07-03 03:33:59.000000000 +0200 @@ -1,13 +1,9 @@ -{-# LANGUAGE CPP #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE UndecidableInstances #-} -#if __GLASGOW_HASKELL__ >= 702 && __GLASGOW_HASKELL__ <= 708 -{-# LANGUAGE Trustworthy #-} -#endif ----------------------------------------------------------------------------- -- | -- Module : Data.Profunctor.Composition @@ -86,9 +82,9 @@ rmap k (Procompose f g) = Procompose (rmap k f) g {-# INLINE lmap #-} k #. Procompose f g = Procompose (k #. f) g - {-# INLINE ( #. ) #-} + {-# INLINE (#.) #-} Procompose f g .# k = Procompose f (g .# k) - {-# INLINE ( .# ) #-} + {-# INLINE (.#) #-} instance Profunctor p => Functor (Procompose p q a) where fmap k (Procompose f g) = Procompose (rmap k f) g @@ -259,7 +255,7 @@ rmap bd f = Rift (runRift f . lmap bd) {-# INLINE rmap #-} bd #. f = Rift (\p -> runRift f (p .# bd)) - {-# INLINE ( #. ) #-} + {-# INLINE (#.) #-} f .# ca = Rift (\p -> runRift f p .# ca) {-# INLINE (.#) #-} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/profunctors-5.2.2/src/Data/Profunctor/Mapping.hs new/profunctors-5.3/src/Data/Profunctor/Mapping.hs --- old/profunctors-5.2.2/src/Data/Profunctor/Mapping.hs 2018-01-18 21:05:00.000000000 +0100 +++ new/profunctors-5.3/src/Data/Profunctor/Mapping.hs 2018-07-03 03:33:59.000000000 +0200 @@ -1,6 +1,16 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE RankNTypes #-} +----------------------------------------------------------------------------- +-- | +-- Copyright : (C) 2015-2018 Edward Kmett +-- License : BSD-style (see the file LICENSE) +-- +-- Maintainer : Edward Kmett <[email protected]> +-- Stability : experimental +-- Portability : portable +-- +---------------------------------------------------------------------------- module Data.Profunctor.Mapping ( Mapping(..) , CofreeMapping(..) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/profunctors-5.2.2/src/Data/Profunctor/Ran.hs new/profunctors-5.3/src/Data/Profunctor/Ran.hs --- old/profunctors-5.2.2/src/Data/Profunctor/Ran.hs 2018-01-18 21:05:00.000000000 +0100 +++ new/profunctors-5.3/src/Data/Profunctor/Ran.hs 2018-07-03 03:33:59.000000000 +0200 @@ -1,10 +1,6 @@ -{-# LANGUAGE CPP #-} -{-# LANGUAGE Rank2Types #-} +{-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} -#if __GLASGOW_HASKELL__ >= 702 && __GLASGOW_HASKELL__ <= 708 -{-# LANGUAGE Trustworthy #-} -#endif ----------------------------------------------------------------------------- -- | -- Copyright : (C) 2013-2015 Edward Kmett and Dan Doel @@ -54,7 +50,7 @@ rmap bd f = Ran (rmap bd . runRan f) {-# INLINE rmap #-} bd #. f = Ran (\p -> bd #. runRan f p) - {-# INLINE ( #. ) #-} + {-# INLINE (#.) #-} f .# ca = Ran (\p -> runRan f (ca #. p)) {-# INLINE (.#) #-} @@ -103,7 +99,7 @@ rmap bd f = Codensity (rmap bd . runCodensity f) {-# INLINE rmap #-} bd #. f = Codensity (\p -> bd #. runCodensity f p) - {-# INLINE ( #. ) #-} + {-# INLINE (#.) #-} f .# ca = Codensity (\p -> runCodensity f (ca #. p)) {-# INLINE (.#) #-} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/profunctors-5.2.2/src/Data/Profunctor/Rep.hs new/profunctors-5.3/src/Data/Profunctor/Rep.hs --- old/profunctors-5.2.2/src/Data/Profunctor/Rep.hs 2018-01-18 21:05:00.000000000 +0100 +++ new/profunctors-5.3/src/Data/Profunctor/Rep.hs 2018-07-03 03:33:59.000000000 +0200 @@ -6,9 +6,6 @@ {-# LANGUAGE TypeOperators #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE CPP #-} -#if __GLASGOW_HASKELL__ >= 702 && __GLASGOW_HASKELL__ <= 708 -{-# LANGUAGE Trustworthy #-} -#endif ----------------------------------------------------------------------------- -- | -- Module : Data.Profunctor.Rep @@ -48,6 +45,7 @@ import Control.Applicative import Control.Arrow import Control.Comonad +import Control.Monad ((>=>)) import Data.Functor.Identity import Data.Profunctor import Data.Profunctor.Sieve @@ -193,7 +191,7 @@ instance (Monad (Rep p), Representable p) => Monad (Prep p) where return a = Prep () $ tabulate $ const $ return a - Prep xa pa >>= f = Prep xa $ tabulate $ \xa' -> sieve pa xa' >>= \a -> case f a of + Prep xa pa >>= f = Prep xa $ tabulate $ sieve pa >=> \a -> case f a of Prep xb pb -> sieve pb xb prepAdj :: (forall a. Prep p a -> g a) -> p :-> Star g diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/profunctors-5.2.2/src/Data/Profunctor/Sieve.hs new/profunctors-5.3/src/Data/Profunctor/Sieve.hs --- old/profunctors-5.2.2/src/Data/Profunctor/Sieve.hs 2018-01-18 21:05:00.000000000 +0100 +++ new/profunctors-5.3/src/Data/Profunctor/Sieve.hs 2018-07-03 03:33:59.000000000 +0200 @@ -3,10 +3,7 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FunctionalDependencies #-} -{-# LANGUAGE CPP #-} -#if __GLASGOW_HASKELL__ >= 702 && __GLASGOW_HASKELL__ <= 708 {-# LANGUAGE Trustworthy #-} -#endif ----------------------------------------------------------------------------- -- | -- Copyright : (C) 2015 Edward Kmett diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/profunctors-5.2.2/src/Data/Profunctor/Strong.hs new/profunctors-5.3/src/Data/Profunctor/Strong.hs --- old/profunctors-5.2.2/src/Data/Profunctor/Strong.hs 2018-01-18 21:05:00.000000000 +0100 +++ new/profunctors-5.3/src/Data/Profunctor/Strong.hs 2018-07-03 03:33:59.000000000 +0200 @@ -4,10 +4,6 @@ {-# LANGUAGE TypeOperators #-} {-# LANGUAGE MultiParamTypeClasses #-} -#if __GLASGOW_HASKELL__ >= 704 && __GLASGOW_HASKELL__ < 708 -{-# LANGUAGE Trustworthy #-} -#endif - ----------------------------------------------------------------------------- -- | -- Copyright : (C) 2014-2015 Edward Kmett @@ -93,9 +89,7 @@ second' :: p a b -> p (c, a) (c, b) second' = dimap swap swap . first' -#if __GLASGOW_HASKELL__ >= 708 {-# MINIMAL first' | second' #-} -#endif uncurry' :: Strong p => p a (b -> c) -> p (a, b) c uncurry' = rmap (\(f,x) -> f x) . first' @@ -345,9 +339,7 @@ unsecond :: p (d, a) (d, b) -> p a b unsecond = unfirst . dimap swap swap -#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 708 {-# MINIMAL unfirst | unsecond #-} -#endif instance Costrong (->) where unfirst f a = b where (b, d) = f (a, d) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/profunctors-5.2.2/src/Data/Profunctor/Traversing.hs new/profunctors-5.3/src/Data/Profunctor/Traversing.hs --- old/profunctors-5.2.2/src/Data/Profunctor/Traversing.hs 2018-01-18 21:05:00.000000000 +0100 +++ new/profunctors-5.3/src/Data/Profunctor/Traversing.hs 2018-07-03 03:33:59.000000000 +0200 @@ -118,9 +118,7 @@ wander :: (forall f. Applicative f => (a -> f b) -> s -> f t) -> p a b -> p s t wander f pab = dimap (\s -> Baz $ \afb -> f afb s) sold (traverse' pab) -#if __GLASGOW_HASKELL__ >= 708 {-# MINIMAL wander | traverse' #-} -#endif instance Traversing (->) where traverse' = fmap diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/profunctors-5.2.2/src/Data/Profunctor/Types.hs new/profunctors-5.3/src/Data/Profunctor/Types.hs --- old/profunctors-5.2.2/src/Data/Profunctor/Types.hs 2018-01-18 21:05:00.000000000 +0100 +++ new/profunctors-5.3/src/Data/Profunctor/Types.hs 2018-07-03 03:33:59.000000000 +0200 @@ -3,9 +3,7 @@ {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} -#if __GLASGOW_HASKELL__ >= 702 {-# LANGUAGE Trustworthy #-} -#endif ----------------------------------------------------------------------------- -- | @@ -30,28 +28,21 @@ , Costar(..) , WrappedArrow(..) , Forget(..) -#ifndef HLINT , (:->) -#endif ) where import Control.Applicative hiding (WrappedArrow(..)) import Control.Arrow import Control.Category import Control.Comonad -import Control.Monad (MonadPlus(..)) +import Control.Monad (MonadPlus(..), (>=>)) +import Data.Coerce (Coercible, coerce) import Data.Distributive import Data.Foldable import Data.Monoid hiding (Product) import Data.Profunctor.Unsafe import Data.Traversable -import Prelude hiding (id,(.),sequence) - -#if __GLASGOW_HASKELL__ >= 708 -import Data.Coerce -#else -import Unsafe.Coerce -#endif +import Prelude hiding (id,(.)) infixr 0 :-> type p :-> q = forall a b. p a b -> q a b @@ -70,13 +61,9 @@ {-# INLINE lmap #-} rmap k (Star f) = Star (fmap k . f) {-# INLINE rmap #-} - -- We cannot safely overload ( #. ) because we didn't write the 'Functor'. -#if __GLASGOW_HASKELL__ >= 708 + -- We cannot safely overload (#.) because we didn't write the 'Functor'. p .# _ = coerce p -#else - p .# _ = unsafeCoerce p -#endif - {-# INLINE ( .# ) #-} + {-# INLINE (.#) #-} instance Functor f => Functor (Star f a) where fmap = rmap @@ -109,7 +96,7 @@ instance Monad f => Category (Star f) where id = Star return - Star f . Star g = Star $ \a -> g a >>= f + Star f . Star g = Star $ g >=> f ------------------------------------------------------------------------------ -- Costar @@ -125,13 +112,9 @@ {-# INLINE lmap #-} rmap k (Costar f) = Costar (k . f) {-# INLINE rmap #-} -#if __GLASGOW_HASKELL__ >= 708 - ( #. ) _ = coerce (\x -> x :: b) :: forall a b. Coercible b a => a -> b -#else - ( #. ) _ = unsafeCoerce -#endif - {-# INLINE ( #. ) #-} - -- We cannot overload ( .# ) because we didn't write the 'Functor'. + (#.) _ = coerce (\x -> x :: b) :: forall a b. Coercible b a => a -> b + {-# INLINE (#.) #-} + -- We cannot overload (.#) because we didn't write the 'Functor'. instance Distributive (Costar f d) where distribute fs = Costar $ \gd -> fmap (($ gd) .# runCostar) fs @@ -204,7 +187,7 @@ {-# INLINE lmap #-} rmap = (^<<) {-# INLINE rmap #-} - -- We cannot safely overload ( #. ) or ( .# ) because we didn't write the 'Arrow'. + -- We cannot safely overload (#.) or (.#) because we didn't write the 'Arrow'. ------------------------------------------------------------------------------ -- Forget diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/profunctors-5.2.2/src/Data/Profunctor/Unsafe.hs new/profunctors-5.3/src/Data/Profunctor/Unsafe.hs --- old/profunctors-5.2.2/src/Data/Profunctor/Unsafe.hs 2018-01-18 21:05:00.000000000 +0100 +++ new/profunctors-5.3/src/Data/Profunctor/Unsafe.hs 2018-07-03 03:33:59.000000000 +0200 @@ -1,13 +1,9 @@ {-# LANGUAGE CPP #-} -#if __GLASGOW_HASKELL__ >= 708 {-# LANGUAGE Trustworthy #-} -#elif __GLASGOW_HASKELL >= 704 -{-# LANGUAGE Unsafe #-} -#endif {-# LANGUAGE ScopedTypeVariables #-} ----------------------------------------------------------------------------- -- | --- Copyright : (C) 2011-2015 Edward Kmett +-- Copyright : (C) 2011-2018 Edward Kmett -- License : BSD-style (see the file LICENSE) -- -- Maintainer : Edward Kmett <[email protected]> @@ -42,24 +38,15 @@ import Data.Bifunctor.Clown (Clown(..)) import Data.Bifunctor.Joker (Joker(..)) import Data.Bifunctor.Product (Product(..)) +import Data.Bifunctor.Sum (Sum(..)) import Data.Bifunctor.Tannen (Tannen(..)) +import Data.Coerce (Coercible, coerce) #if __GLASGOW_HASKELL__ < 710 import Data.Functor #endif import Data.Functor.Contravariant (Contravariant(..)) import Data.Tagged -import Prelude hiding (id,(.),sequence) - -#if __GLASGOW_HASKELL__ >= 708 -import Data.Coerce -#else -import Unsafe.Coerce -#endif - -#ifdef HLINT -{-# ANN module "Hlint: ignore Redundant lambda" #-} -{-# ANN module "Hlint: ignore Collapse lambdas" #-} -#endif +import Prelude hiding (id,(.)) infixr 9 #. infixl 8 .# @@ -145,14 +132,10 @@ -- The semantics of this function with respect to bottoms -- should match the default definition: -- - -- @('Profuctor.Unsafe.#.') ≡ \\f -> \\p -> p \`seq\` 'rmap' f p@ -#if __GLASGOW_HASKELL__ >= 708 - ( #. ) :: Coercible c b => (b -> c) -> p a b -> p a c -#else - ( #. ) :: (b -> c) -> p a b -> p a c -#endif - ( #. ) = \f -> \p -> p `seq` rmap f p - {-# INLINE ( #. ) #-} + -- @('Profuctor.Unsafe.#.') ≡ \\_ -> \\p -> p \`seq\` 'rmap' 'coerce' p@ + (#.) :: forall a b c q. Coercible c b => q b c -> p a b -> p a c + (#.) = \_ -> \p -> p `seq` rmap (coerce (id :: c -> c) :: b -> c) p + {-# INLINE (#.) #-} -- | Strictly map the first argument argument -- contravariantly with a function that is assumed @@ -175,18 +158,12 @@ -- will only call this with a second argument that is -- operationally identity. -- - -- @('.#') ≡ \\p -> p \`seq\` \\f -> 'lmap' f p@ -#if __GLASGOW_HASKELL__ >= 708 - ( .# ) :: Coercible b a => p b c -> (a -> b) -> p a c -#else - ( .# ) :: p b c -> (a -> b) -> p a c -#endif - ( .# ) = \p -> p `seq` \f -> lmap f p - {-# INLINE ( .# ) #-} + -- @('.#') ≡ \\p -> p \`seq\` \\f -> 'lmap' 'coerce' p@ + (.#) :: forall a b c q. Coercible b a => p b c -> q a b -> p a c + (.#) = \p -> p `seq` \_ -> lmap (coerce (id :: b -> b) :: a -> b) p + {-# INLINE (.#) #-} -#if __GLASGOW_HASKELL__ >= 708 {-# MINIMAL dimap | (lmap, rmap) #-} -#endif instance Profunctor (->) where dimap ab cd bc = cd . bc . ab @@ -195,15 +172,10 @@ {-# INLINE lmap #-} rmap = (.) {-# INLINE rmap #-} -#if __GLASGOW_HASKELL__ >= 708 - ( #. ) _ = coerce (\x -> x :: b) :: forall a b. Coercible b a => a -> b - ( .# ) pbc _ = coerce pbc -#else - ( #. ) _ = unsafeCoerce - ( .# ) pbc _ = unsafeCoerce pbc -#endif - {-# INLINE ( #. ) #-} - {-# INLINE ( .# ) #-} + (#.) _ = coerce (\x -> x :: b) :: forall a b. Coercible b a => a -> b + (.#) pbc _ = coerce pbc + {-# INLINE (#.) #-} + {-# INLINE (.#) #-} instance Profunctor Tagged where dimap _ f (Tagged s) = Tagged (f s) @@ -212,14 +184,10 @@ {-# INLINE lmap #-} rmap = fmap {-# INLINE rmap #-} -#if __GLASGOW_HASKELL__ >= 708 - ( #. ) _ = coerce (\x -> x :: b) :: forall a b. Coercible b a => a -> b -#else - ( #. ) _ = unsafeCoerce -#endif - {-# INLINE ( #. ) #-} + (#.) _ = coerce (\x -> x :: b) :: forall a b. Coercible b a => a -> b + {-# INLINE (#.) #-} Tagged s .# _ = Tagged s - {-# INLINE ( .# ) #-} + {-# INLINE (.#) #-} instance Monad m => Profunctor (Kleisli m) where dimap f g (Kleisli h) = Kleisli (liftM g . h . f) @@ -229,12 +197,8 @@ rmap k (Kleisli f) = Kleisli (liftM k . f) {-# INLINE rmap #-} -- We cannot safely overload (#.) because we didn't provide the 'Monad'. -#if __GLASGOW_HASKELL__ >= 708 - ( .# ) pbc _ = coerce pbc -#else - ( .# ) pbc _ = unsafeCoerce pbc -#endif - {-# INLINE ( .# ) #-} + (.#) pbc _ = coerce pbc + {-# INLINE (.#) #-} instance Functor w => Profunctor (Cokleisli w) where dimap f g (Cokleisli h) = Cokleisli (g . h . fmap f) @@ -244,12 +208,8 @@ rmap k (Cokleisli f) = Cokleisli (k . f) {-# INLINE rmap #-} -- We cannot safely overload (.#) because we didn't provide the 'Functor'. -#if __GLASGOW_HASKELL__ >= 708 - ( #. ) _ = coerce (\x -> x :: b) :: forall a b. Coercible b a => a -> b -#else - ( #. ) _ = unsafeCoerce -#endif - {-# INLINE ( #. ) #-} + (#.) _ = coerce (\x -> x :: b) :: forall a b. Coercible b a => a -> b + {-# INLINE (#.) #-} instance Contravariant f => Profunctor (Clown f) where lmap f (Clown fa) = Clown (contramap f fa) @@ -279,10 +239,27 @@ {-# INLINE rmap #-} dimap f g (Pair p q) = Pair (dimap f g p) (dimap f g q) {-# INLINE dimap #-} - ( #. ) f (Pair p q) = Pair (f #. p) (f #. q) - {-# INLINE ( #. ) #-} - ( .# ) (Pair p q) f = Pair (p .# f) (q .# f) - {-# INLINE ( .# ) #-} + (#.) f (Pair p q) = Pair (f #. p) (f #. q) + {-# INLINE (#.) #-} + (.#) (Pair p q) f = Pair (p .# f) (q .# f) + {-# INLINE (.#) #-} + +instance (Profunctor p, Profunctor q) => Profunctor (Sum p q) where + lmap f (L2 x) = L2 (lmap f x) + lmap f (R2 y) = R2 (lmap f y) + {-# INLINE lmap #-} + rmap g (L2 x) = L2 (rmap g x) + rmap g (R2 y) = R2 (rmap g y) + {-# INLINE rmap #-} + dimap f g (L2 x) = L2 (dimap f g x) + dimap f g (R2 y) = R2 (dimap f g y) + {-# INLINE dimap #-} + f #. L2 x = L2 (f #. x) + f #. R2 y = R2 (f #. y) + {-# INLINE (#.) #-} + L2 x .# f = L2 (x .# f) + R2 y .# f = R2 (y .# f) + {-# INLINE (.#) #-} instance (Functor f, Profunctor p) => Profunctor (Tannen f p) where lmap f (Tannen h) = Tannen (lmap f <$> h) @@ -291,7 +268,7 @@ {-# INLINE rmap #-} dimap f g (Tannen h) = Tannen (dimap f g <$> h) {-# INLINE dimap #-} - ( #. ) f (Tannen h) = Tannen ((f #.) <$> h) - {-# INLINE ( #. ) #-} - ( .# ) (Tannen h) f = Tannen ((.# f) <$> h) - {-# INLINE ( .# ) #-} + (#.) f (Tannen h) = Tannen ((f #.) <$> h) + {-# INLINE (#.) #-} + (.#) (Tannen h) f = Tannen ((.# f) <$> h) + {-# INLINE (.#) #-} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/profunctors-5.2.2/src/Data/Profunctor/Yoneda.hs new/profunctors-5.3/src/Data/Profunctor/Yoneda.hs --- old/profunctors-5.2.2/src/Data/Profunctor/Yoneda.hs 2018-01-18 21:05:00.000000000 +0100 +++ new/profunctors-5.3/src/Data/Profunctor/Yoneda.hs 2018-07-03 03:33:59.000000000 +0200 @@ -1,12 +1,9 @@ -{-# LANGUAGE CPP #-} {-# LANGUAGE GADTs #-} -{-# LANGUAGE Rank2Types #-} +{-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} -#if __GLASGOW_HASKELL__ >= 702 && __GLASGOW_HASKELL__ <= 708 {-# LANGUAGE Trustworthy #-} -#endif ----------------------------------------------------------------------------- -- | -- Copyright : (C) 2017 Edward Kmett @@ -23,18 +20,13 @@ ) where import Control.Category +import Data.Coerce (Coercible, coerce) import Data.Profunctor import Data.Profunctor.Monad import Data.Profunctor.Traversing import Data.Profunctor.Unsafe import Prelude hiding (id,(.)) -#if __GLASGOW_HASKELL__ >= 708 -import Data.Coerce -#else -import Unsafe.Coerce -#endif - -------------------------------------------------------------------------------- -- * Yoneda -------------------------------------------------------------------------------- @@ -68,17 +60,10 @@ {-# INLINE lmap #-} rmap r p = Yoneda $ \l r' -> runYoneda p l (r' . r) {-# INLINE rmap #-} -#if __GLASGOW_HASKELL__ >= 708 - ( .# ) p _ = coerce p - {-# INLINE ( .# ) #-} - ( #. ) _ = coerce (\x -> x :: b) :: forall a b. Coercible b a => a -> b - {-# INLINE ( #. ) #-} -#else - ( .# ) p _ = unsafeCoerce p - {-# INLINE ( .# ) #-} - ( #. ) _ = unsafeCoerce - {-# INLINE ( #. ) #-} -#endif + (.#) p _ = coerce p + {-# INLINE (.#) #-} + (#.) _ = coerce (\x -> x :: b) :: forall a b. Coercible b a => a -> b + {-# INLINE (#.) #-} instance Functor (Yoneda p a) where fmap f p = Yoneda $ \l r -> runYoneda p l (r . f) @@ -178,17 +163,10 @@ {-# INLINE lmap #-} rmap r (Coyoneda l r' p) = Coyoneda l (r . r') p {-# INLINE rmap #-} -#if __GLASGOW_HASKELL__ >= 708 - ( .# ) p _ = coerce p - {-# INLINE ( .# ) #-} - ( #. ) _ = coerce (\x -> x :: b) :: forall a b. Coercible b a => a -> b - {-# INLINE ( #. ) #-} -#else - ( .# ) p _ = unsafeCoerce p - {-# INLINE ( .# ) #-} - ( #. ) _ = unsafeCoerce - {-# INLINE ( #. ) #-} -#endif + (.#) p _ = coerce p + {-# INLINE (.#) #-} + (#.) _ = coerce (\x -> x :: b) :: forall a b. Coercible b a => a -> b + {-# INLINE (#.) #-} instance ProfunctorFunctor Coyoneda where promap f (Coyoneda l r p) = Coyoneda l r (f p) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/profunctors-5.2.2/src/Data/Profunctor.hs new/profunctors-5.3/src/Data/Profunctor.hs --- old/profunctors-5.2.2/src/Data/Profunctor.hs 2018-01-18 21:05:00.000000000 +0100 +++ new/profunctors-5.3/src/Data/Profunctor.hs 2018-07-03 03:33:59.000000000 +0200 @@ -1,10 +1,6 @@ -{-# LANGUAGE CPP #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} -#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 702 && __GLASGOW_HASKELL__ < 708 -{-# LANGUAGE Trustworthy #-} -#endif ----------------------------------------------------------------------------- -- | -- Copyright : (C) 2011-2015 Edward Kmett, @@ -42,9 +38,7 @@ , Costar(..) , WrappedArrow(..) , Forget(..) -#ifndef HLINT , (:->) -#endif ) where import Data.Profunctor.Choice
