Hello community, here is the log from the commit of package ghc-semigroupoids for openSUSE:Factory checked in at 2018-05-30 12:13:04 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-semigroupoids (Old) and /work/SRC/openSUSE:Factory/.ghc-semigroupoids.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-semigroupoids" Wed May 30 12:13:04 2018 rev:7 rq:607879 version:5.2.2 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-semigroupoids/ghc-semigroupoids.changes 2017-08-31 20:59:02.405695330 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-semigroupoids.new/ghc-semigroupoids.changes 2018-05-30 12:27:09.078600733 +0200 @@ -1,0 +2,20 @@ +Mon May 14 17:02:11 UTC 2018 - [email protected] + +- Update semigroupoids to version 5.2.2 revision 3. + * Add `optional` to `Data.Functor.Alt` (analogous to the `optional` function + in `Control.Applicative`) + * `liftF2` is now a class method of `Apply` (mirroring the fact that `liftA2` + is now a class method of `Applicative`). `liftF2` and `(<.>)` have default + definitions in terms of the other. + * Allow building with GHC 8.4 + * `Apply` and `Bind` instances for `Q`, from the `template-haskell` package. + * Add instances for `(:~:)` and `(:~~:)` from `Data.Type.Equality`, and + `Coercion` from `Data.Type.Coercion` + * Add the `toNonEmpty` method to `Foldable1`. Add `foldrM1` and `foldlM1` + functions to `Data.Semigroup.Foldable` that are defined in terms of `toNonEmpty`. + * Add `Apply`, `Bind`, `Foldable1`, and `Traversable1` instances for `Complex` + * Add `Apply` and `Bind` instances for `HashMap` from the `unordered-containers` package + (on which `semigroupoids` now depends) + * Add `Semigroupoid` instances for `Tagged` and `Const` + +------------------------------------------------------------------- Old: ---- semigroupoids-5.2.tar.gz New: ---- semigroupoids-5.2.2.tar.gz semigroupoids.cabal ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-semigroupoids.spec ++++++ --- /var/tmp/diff_new_pack.e9xT6Q/_old 2018-05-30 12:27:10.454553162 +0200 +++ /var/tmp/diff_new_pack.e9xT6Q/_new 2018-05-30 12:27:10.462552885 +0200 @@ -1,7 +1,7 @@ # # spec file for package ghc-semigroupoids # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 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,13 +19,14 @@ %global pkg_name semigroupoids %bcond_with tests Name: ghc-%{pkg_name} -Version: 5.2 +Version: 5.2.2 Release: 0 Summary: Semigroupoids: Category sans id License: BSD-2-Clause -Group: Development/Languages/Other -Url: https://hackage.haskell.org/package/%{pkg_name} +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/3.cabal#/%{pkg_name}.cabal BuildRequires: ghc-Cabal-devel BuildRequires: ghc-base-orphans-devel BuildRequires: ghc-bifunctors-devel @@ -34,12 +35,14 @@ BuildRequires: ghc-containers-devel BuildRequires: ghc-contravariant-devel BuildRequires: ghc-distributive-devel +BuildRequires: ghc-hashable-devel BuildRequires: ghc-rpm-macros BuildRequires: ghc-semigroups-devel BuildRequires: ghc-tagged-devel +BuildRequires: ghc-template-haskell-devel BuildRequires: ghc-transformers-compat-devel BuildRequires: ghc-transformers-devel -BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildRequires: ghc-unordered-containers-devel %if %{with tests} BuildRequires: ghc-doctest-devel %endif @@ -83,7 +86,7 @@ %package devel Summary: Haskell %{pkg_name} library development files -Group: Development/Libraries/Other +Group: Development/Libraries/Haskell Requires: %{name} = %{version}-%{release} Requires: ghc-compiler = %{ghc_version} Requires(post): ghc-compiler = %{ghc_version} @@ -94,6 +97,7 @@ %prep %setup -q -n %{pkg_name}-%{version} +cp -p %{SOURCE1} %{pkg_name}.cabal %build %ghc_lib_build @@ -111,11 +115,9 @@ %ghc_pkg_recache %files -f %{name}.files -%defattr(-,root,root,-) -%doc LICENSE +%license LICENSE %files devel -f %{name}-devel.files -%defattr(-,root,root,-) %doc CHANGELOG.markdown README.markdown %changelog ++++++ semigroupoids-5.2.tar.gz -> semigroupoids-5.2.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/semigroupoids-5.2/.travis.yml new/semigroupoids-5.2.2/.travis.yml --- old/semigroupoids-5.2/.travis.yml 2017-04-19 17:14:28.000000000 +0200 +++ new/semigroupoids-5.2.2/.travis.yml 2018-01-18 21:07:06.000000000 +0100 @@ -1,121 +1,147 @@ -# This file has been generated -- see https://github.com/hvr/multi-ghc-travis +# 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' +# +# For more information, see https://github.com/hvr/multi-ghc-travis +# language: c sudo: false +git: + submodules: false # whether to recursively clone submodules + +notifications: + irc: + channels: + - "irc.freenode.org#haskell-lens" + skip_join: true + template: + - "\x0313semigroupoids\x03/\x0306%{branch}\x03 \x0314%{commit}\x03 %{build_url} %{message}" + cache: directories: - - $HOME/.cabsnap - $HOME/.cabal/packages + - $HOME/.cabal/store before_cache: - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log - - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.tar + # 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: include: - - env: CABALVER=1.24 GHCVER=7.0.4 - compiler: ": #GHC 7.0.4" - addons: {apt: {packages: [cabal-install-1.24,ghc-7.0.4], sources: [hvr-ghc]}} - - env: CABALVER=1.24 GHCVER=7.2.2 - compiler: ": #GHC 7.2.2" - addons: {apt: {packages: [cabal-install-1.24,ghc-7.2.2], sources: [hvr-ghc]}} - - env: CABALVER=1.24 GHCVER=7.4.2 - compiler: ": #GHC 7.4.2" - addons: {apt: {packages: [cabal-install-1.24,ghc-7.4.2], sources: [hvr-ghc]}} - - env: CABALVER=1.24 GHCVER=7.6.3 - compiler: ": #GHC 7.6.3" - addons: {apt: {packages: [cabal-install-1.24,ghc-7.6.3], sources: [hvr-ghc]}} - - env: CABALVER=1.24 GHCVER=7.8.4 - compiler: ": #GHC 7.8.4" - addons: {apt: {packages: [cabal-install-1.24,ghc-7.8.4], sources: [hvr-ghc]}} - - env: CABALVER=1.24 GHCVER=7.10.3 - compiler: ": #GHC 7.10.3" - addons: {apt: {packages: [cabal-install-1.24,ghc-7.10.3], sources: [hvr-ghc]}} - - env: CABALVER=1.24 GHCVER=8.0.2 - compiler: ": #GHC 8.0.2" - addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.2], sources: [hvr-ghc]}} - - env: CABALVER=1.24 GHCVER=8.2.1 - compiler: ": #GHC 8.2.1" - addons: {apt: {packages: [cabal-install-1.24,ghc-8.2.1], sources: [hvr-ghc]}} - - env: CABALVER=1.24 GHCVER=head - compiler: ": #GHC head" - addons: {apt: {packages: [cabal-install-1.24,ghc-head], sources: [hvr-ghc]}} + - 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" + # 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" + # 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" + # env: TEST=--disable-tests BENCH=--disable-benchmarks + addons: {apt: {packages: [*apt_packages,cabal-install-2.0,ghc-7.8.4], 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" + # 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]}} + - compiler: "ghc-head" + env: GHCHEAD=true + addons: {apt: {packages: [*apt_packages,cabal-install-head,ghc-head], sources: [hvr-ghc]}} allow_failures: - - env: CABALVER=1.24 GHCVER=7.0.4 - - env: CABALVER=1.24 GHCVER=7.2.2 - - env: CABALVER=1.24 GHCVER=head + - compiler: "ghc-7.0.4" + - compiler: "ghc-7.2.2" + - compiler: "ghc-8.4.1" + - compiler: "ghc-head" before_install: - - unset CC - - export PATH=$HOME/.cabal/bin:/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH + - HC=${CC} + - HCPKG=${HC/ghc/ghc-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/') )) + - echo $HCNUMVER install: - - cabal --version - - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]" - - if [ -f $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz ]; - then - zcat $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz > - $HOME/.cabal/packages/hackage.haskell.org/00-index.tar; - fi - - travis_retry cabal update -v - - sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config - - cabal install --only-dependencies --enable-tests --dry -v > installplan.txt - - sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt - -# check whether current requested install-plan matches cached package-db snapshot - - if diff -u installplan.txt $HOME/.cabsnap/installplan.txt; - then - echo "cabal build-cache HIT"; - rm -rfv .ghc; - cp -a $HOME/.cabsnap/ghc $HOME/.ghc; - cp -a $HOME/.cabsnap/lib $HOME/.cabsnap/share $HOME/.cabsnap/bin $HOME/.cabal/; - else - echo "cabal build-cache MISS"; - rm -rf $HOME/.cabsnap; - mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin; - cabal install -j --only-dependencies --enable-tests; - fi - -# snapshot package-db on cache miss - - if [ ! -d $HOME/.cabsnap ]; - then - echo "snapshotting package-db to build-cache"; - mkdir $HOME/.cabsnap; - cp -a $HOME/.ghc $HOME/.cabsnap/ghc; - cp -a $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin installplan.txt $HOME/.cabsnap/; - fi - -# 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. -script: - # -v2 provides useful information for debugging - - cabal configure --enable-tests -v2 + - 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} + - INSTALLED=${INSTALLED-true} + - 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.bak 's/-- allow-newer:.*/allow-newer: *:base, *:template-haskell, *:ghc, *:Cabal/' ${HOME}/.cabal/config + + 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 + + cabal new-update head.hackage -v + fi + - grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$' + - "printf 'packages: \".\"\\n' > cabal.project" + - cat cabal.project + - 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) - # this builds all libraries and executables - # (including tests/benchmarks) - - cabal build - - - cabal test - - # tests that a source-distribution can be generated - - cabal sdist - - # check that the generated source-distribution can be built & installed - - export SRC_TGZ=$(cabal info . | awk '{print $2 ".tar.gz";exit}') ; - cd dist/; - if [ -f "$SRC_TGZ" ]; then - cabal install --force-reinstalls "$SRC_TGZ"; - else - echo "expected '$SRC_TGZ' not found"; - exit 1; - fi +# 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. +script: + # test that source-distributions can be generated + - (cd "." && cabal sdist) + - mv "."/dist/semigroupoids-*.tar.gz ${DISTDIR}/ + - cd ${DISTDIR} || false + - find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \; + - "printf 'packages: semigroupoids-*/*.cabal\\n' > cabal.project" + - cat cabal.project + + + # 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 semigroupoids-* && cabal check) + + # haddock + - rm -rf ./dist-newstyle + - if $HADDOCK; then cabal new-haddock -w ${HC} ${TEST} ${BENCH} all; else echo "Skipping haddock generation";fi -notifications: - irc: - channels: - - "irc.freenode.org#haskell-lens" - skip_join: true - template: - - "\x0313semigroupoids\x03/\x0306%{branch}\x03 \x0314%{commit}\x03 %{build_url} %{message}" +# REGENDATA ["-o",".travis.yml","--irc-channel=irc.freenode.org#haskell-lens","--no-no-tests-no-bench","--no-installed","cabal.project"] +# EOF diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/semigroupoids-5.2/CHANGELOG.markdown new/semigroupoids-5.2.2/CHANGELOG.markdown --- old/semigroupoids-5.2/CHANGELOG.markdown 2017-04-19 17:14:28.000000000 +0200 +++ new/semigroupoids-5.2.2/CHANGELOG.markdown 2018-01-18 21:07:06.000000000 +0100 @@ -1,3 +1,24 @@ +5.2.2 [2018.01.18] +------------------ +* Add `optional` to `Data.Functor.Alt` (analogous to the `optional` function + in `Control.Applicative`) +* `liftF2` is now a class method of `Apply` (mirroring the fact that `liftA2` + is now a class method of `Applicative`). `liftF2` and `(<.>)` have default + definitions in terms of the other. +* Allow building with GHC 8.4 +* `Apply` and `Bind` instances for `Q`, from the `template-haskell` package. +* Add instances for `(:~:)` and `(:~~:)` from `Data.Type.Equality`, and + `Coercion` from `Data.Type.Coercion` + +5.2.1 +----- +* Add the `toNonEmpty` method to `Foldable1`. Add `foldrM1` and `foldlM1` + functions to `Data.Semigroup.Foldable` that are defined in terms of `toNonEmpty`. +* Add `Apply`, `Bind`, `Foldable1`, and `Traversable1` instances for `Complex` +* Add `Apply` and `Bind` instances for `HashMap` from the `unordered-containers` package + (on which `semigroupoids` now depends) +* Add `Semigroupoid` instances for `Tagged` and `Const` + 5.2 --- * Revamp `Setup.hs` to use `cabal-doctest`. This makes it build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/semigroupoids-5.2/Setup.lhs new/semigroupoids-5.2.2/Setup.lhs --- old/semigroupoids-5.2/Setup.lhs 2017-04-19 17:14:28.000000000 +0200 +++ new/semigroupoids-5.2.2/Setup.lhs 2018-01-18 21:07:06.000000000 +0100 @@ -1,182 +1,34 @@ \begin{code} {-# LANGUAGE CPP #-} -{-# LANGUAGE OverloadedStrings #-} +{-# OPTIONS_GHC -Wall #-} module Main (main) where #ifndef MIN_VERSION_cabal_doctest #define MIN_VERSION_cabal_doctest(x,y,z) 0 #endif - #if MIN_VERSION_cabal_doctest(1,0,0) -import Distribution.Extra.Doctest ( defaultMainWithDoctests ) -#else --- Otherwise we provide a shim - -#ifndef MIN_VERSION_Cabal -#define MIN_VERSION_Cabal(x,y,z) 0 -#endif -#ifndef MIN_VERSION_directory -#define MIN_VERSION_directory(x,y,z) 0 -#endif -#if MIN_VERSION_Cabal(1,24,0) -#define InstalledPackageId UnitId -#endif - -import Control.Monad ( when ) -import Data.List ( nub ) -import Data.String ( fromString ) -import Distribution.Package ( InstalledPackageId ) -import Distribution.Package ( PackageId, Package (..), packageVersion ) -import Distribution.PackageDescription ( PackageDescription(), TestSuite(..) , Library (..), BuildInfo (..)) -import Distribution.Simple ( defaultMainWithHooks, UserHooks(..), simpleUserHooks ) -import Distribution.Simple.Utils ( rewriteFile, createDirectoryIfMissingVerbose ) -import Distribution.Simple.BuildPaths ( autogenModulesDir ) -import Distribution.Simple.Setup ( BuildFlags(buildDistPref, buildVerbosity), fromFlag) -import Distribution.Simple.LocalBuildInfo ( withPackageDB, withLibLBI, withTestLBI, LocalBuildInfo(), ComponentLocalBuildInfo(componentPackageDeps), compiler ) -import Distribution.Simple.Compiler ( showCompilerId , PackageDB (..)) -import Distribution.Text ( display , simpleParse ) -import System.FilePath ( (</>) ) - -#if MIN_VERSION_Cabal(1,25,0) -import Distribution.Simple.BuildPaths ( autogenComponentModulesDir ) -#endif +import Distribution.Extra.Doctest ( defaultMainWithDoctests ) +main :: IO () +main = defaultMainWithDoctests "doctests" -#if MIN_VERSION_directory(1,2,2) -import System.Directory (makeAbsolute) #else -import System.Directory (getCurrentDirectory) -import System.FilePath (isAbsolute) -makeAbsolute :: FilePath -> IO FilePath -makeAbsolute p | isAbsolute p = return p - | otherwise = do - cwd <- getCurrentDirectory - return $ cwd </> p +#ifdef MIN_VERSION_Cabal +-- If the macro is defined, we have new cabal-install, +-- but for some reason we don't have cabal-doctest in package-db +-- +-- Probably we are running cabal sdist, when otherwise using new-build +-- workflow +import Warning () #endif -generateBuildModule :: String -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO () -generateBuildModule testsuiteName flags pkg lbi = do - let verbosity = fromFlag (buildVerbosity flags) - let distPref = fromFlag (buildDistPref flags) - - -- Package DBs - let dbStack = withPackageDB lbi ++ [ SpecificPackageDB $ distPref </> "package.conf.inplace" ] - let dbFlags = "-hide-all-packages" : packageDbArgs dbStack - - withLibLBI pkg lbi $ \lib libcfg -> do - let libBI = libBuildInfo lib - - -- modules - let modules = exposedModules lib ++ otherModules libBI - -- it seems that doctest is happy to take in module names, not actual files! - let module_sources = modules - - -- We need the directory with library's cabal_macros.h! -#if MIN_VERSION_Cabal(1,25,0) - let libAutogenDir = autogenComponentModulesDir lbi libcfg -#else - let libAutogenDir = autogenModulesDir lbi -#endif +import Distribution.Simple - -- Lib sources and includes - iArgs <- mapM (fmap ("-i"++) . makeAbsolute) $ libAutogenDir : hsSourceDirs libBI - includeArgs <- mapM (fmap ("-I"++) . makeAbsolute) $ includeDirs libBI - - -- CPP includes, i.e. include cabal_macros.h - let cppFlags = map ("-optP"++) $ - [ "-include", libAutogenDir ++ "/cabal_macros.h" ] - ++ cppOptions libBI - - withTestLBI pkg lbi $ \suite suitecfg -> when (testName suite == fromString testsuiteName) $ do - - -- get and create autogen dir -#if MIN_VERSION_Cabal(1,25,0) - let testAutogenDir = autogenComponentModulesDir lbi suitecfg -#else - let testAutogenDir = autogenModulesDir lbi -#endif - createDirectoryIfMissingVerbose verbosity True testAutogenDir - - -- write autogen'd file - rewriteFile (testAutogenDir </> "Build_doctests.hs") $ unlines - [ "module Build_doctests where" - , "" - -- -package-id etc. flags - , "pkgs :: [String]" - , "pkgs = " ++ (show $ formatDeps $ testDeps libcfg suitecfg) - , "" - , "flags :: [String]" - , "flags = " ++ show (iArgs ++ includeArgs ++ dbFlags ++ cppFlags) - , "" - , "module_sources :: [String]" - , "module_sources = " ++ show (map display module_sources) - ] - where - -- we do this check in Setup, as then doctests don't need to depend on Cabal - isOldCompiler = maybe False id $ do - a <- simpleParse $ showCompilerId $ compiler lbi - b <- simpleParse "7.5" - return $ packageVersion (a :: PackageId) < b - - formatDeps = map formatOne - formatOne (installedPkgId, pkgId) - -- The problem is how different cabal executables handle package databases - -- when doctests depend on the library - | packageId pkg == pkgId = "-package=" ++ display pkgId - | otherwise = "-package-id=" ++ display installedPkgId - - -- From Distribution.Simple.Program.GHC - packageDbArgs :: [PackageDB] -> [String] - packageDbArgs | isOldCompiler = packageDbArgsConf - | otherwise = packageDbArgsDb - - -- GHC <7.6 uses '-package-conf' instead of '-package-db'. - packageDbArgsConf :: [PackageDB] -> [String] - packageDbArgsConf dbstack = case dbstack of - (GlobalPackageDB:UserPackageDB:dbs) -> concatMap specific dbs - (GlobalPackageDB:dbs) -> ("-no-user-package-conf") - : concatMap specific dbs - _ -> ierror - where - specific (SpecificPackageDB db) = [ "-package-conf=" ++ db ] - specific _ = ierror - ierror = error $ "internal error: unexpected package db stack: " - ++ show dbstack - - -- GHC >= 7.6 uses the '-package-db' flag. See - -- https://ghc.haskell.org/trac/ghc/ticket/5977. - packageDbArgsDb :: [PackageDB] -> [String] - -- special cases to make arguments prettier in common scenarios - packageDbArgsDb dbstack = case dbstack of - (GlobalPackageDB:UserPackageDB:dbs) - | all isSpecific dbs -> concatMap single dbs - (GlobalPackageDB:dbs) - | all isSpecific dbs -> "-no-user-package-db" - : concatMap single dbs - dbs -> "-clear-package-db" - : concatMap single dbs - where - single (SpecificPackageDB db) = [ "-package-db=" ++ db ] - single GlobalPackageDB = [ "-global-package-db" ] - single UserPackageDB = [ "-user-package-db" ] - isSpecific (SpecificPackageDB _) = True - isSpecific _ = False - -testDeps :: ComponentLocalBuildInfo -> ComponentLocalBuildInfo -> [(InstalledPackageId, PackageId)] -testDeps xs ys = nub $ componentPackageDeps xs ++ componentPackageDeps ys - -defaultMainWithDoctests :: String -> IO () -defaultMainWithDoctests testSuiteName = defaultMainWithHooks simpleUserHooks - { buildHook = \pkg lbi hooks flags -> do - generateBuildModule testSuiteName flags pkg lbi - buildHook simpleUserHooks pkg lbi hooks flags - } +main :: IO () +main = defaultMain #endif -main :: IO () -main = defaultMainWithDoctests "doctests" - \end{code} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/semigroupoids-5.2/Warning.hs new/semigroupoids-5.2.2/Warning.hs --- old/semigroupoids-5.2/Warning.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/semigroupoids-5.2.2/Warning.hs 2018-01-18 21:07:06.000000000 +0100 @@ -0,0 +1,5 @@ +module Warning + {-# WARNING ["You are configuring this package without cabal-doctest installed.", + "The doctests test-suite will not work as a result.", + "To fix this, install cabal-doctest before configuring."] #-} + () where diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/semigroupoids-5.2/semigroupoids.cabal new/semigroupoids-5.2.2/semigroupoids.cabal --- old/semigroupoids-5.2/semigroupoids.cabal 2017-04-19 17:14:28.000000000 +0200 +++ new/semigroupoids-5.2.2/semigroupoids.cabal 2018-01-18 21:07:06.000000000 +0100 @@ -1,6 +1,6 @@ name: semigroupoids category: Control, Comonads -version: 5.2 +version: 5.2.2 license: BSD3 cabal-version: >= 1.8 license-file: LICENSE @@ -10,7 +10,15 @@ homepage: http://github.com/ekmett/semigroupoids bug-reports: http://github.com/ekmett/semigroupoids/issues copyright: Copyright (C) 2011-2015 Edward A. Kmett -tested-with: GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.1 +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 build-type: Custom synopsis: Semigroupoids: Category sans id extra-source-files: @@ -19,6 +27,7 @@ .vim.custom README.markdown CHANGELOG.markdown + Warning.hs description: Provides a wide array of (semi)groupoids and operations for working with them. . @@ -117,19 +126,28 @@ default: True manual: True +flag unordered-containers + description: + You can disable the use of the `unordered-containers` package (and also its dependency `hashable`) using `-f-unordered-containers`. + . + Disabling this is an unsupported configuration, but it may be useful for accelerating builds in sandboxes for expert users. + default: True + manual: True + library build-depends: base >= 4.3 && < 5, base-orphans >= 0.5.4 && < 1, bifunctors >= 5 && < 6, semigroups >= 0.8.3.1 && < 1, + template-haskell, transformers >= 0.2 && < 0.6, transformers-compat >= 0.5 && < 0.6 - if impl(ghc >= 7.0 && < 7.4) - build-depends: generic-deriving >= 1.11 && < 1.12 + if impl(ghc >= 7.0 && < 7.2) + build-depends: generic-deriving >= 1.11 && < 1.13 - if impl(ghc >= 7.4 && < 7.6) + if impl(ghc >= 7.2 && < 7.6) build-depends: ghc-prim if flag(containers) @@ -145,7 +163,11 @@ build-depends: comonad >= 4.2.6 && < 6 if flag(tagged) - build-depends: tagged >= 0.7.3 && < 1 + build-depends: tagged >= 0.8.5 && < 1 + + if flag(unordered-containers) + build-depends: hashable >= 1.1 && < 1.3, + unordered-containers >= 0.2 && < 0.3 hs-source-dirs: src @@ -185,4 +207,5 @@ else build-depends: base >= 4 && < 5, - doctest >= 0.11.1 && < 0.12 + doctest >= 0.11.1 && < 0.14, + semigroupoids diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/semigroupoids-5.2/src/Data/Functor/Alt.hs new/semigroupoids-5.2.2/src/Data/Functor/Alt.hs --- old/semigroupoids-5.2/src/Data/Functor/Alt.hs 2017-04-19 17:14:28.000000000 +0200 +++ new/semigroupoids-5.2.2/src/Data/Functor/Alt.hs 2018-01-18 21:07:06.000000000 +0100 @@ -24,10 +24,11 @@ ---------------------------------------------------------------------------- module Data.Functor.Alt ( Alt(..) + , optional , module Data.Functor.Apply ) where -import Control.Applicative hiding (some, many) +import Control.Applicative hiding (some, many, optional) import Control.Applicative.Backwards import Control.Applicative.Lift import Control.Arrow @@ -50,8 +51,8 @@ import Data.Functor.Compose import Data.Functor.Product import Data.Functor.Reverse -import Data.Semigroup hiding (Product) import Data.List.NonEmpty (NonEmpty(..)) +import Data.Semigroup (Option(..), Semigroup(..)) import Prelude (($),Either(..),Maybe(..),const,IO,Ord,(++),(.),either,seq,undefined) import Unsafe.Coerce @@ -61,6 +62,11 @@ import Data.Sequence (Seq) import qualified Data.Map as Map import Data.Map (Map) +# if MIN_VERSION_base(4,8,0) +import Prelude (mappend) +# else +import Data.Monoid (mappend) +# endif #endif #if defined(MIN_VERSION_tagged) || (MIN_VERSION_base(4,7,0)) @@ -73,6 +79,7 @@ import GHC.Generics #endif + infixl 3 <!> -- | Laws: @@ -117,6 +124,10 @@ where many_v = some_v <!> pure [] some_v = (:) <$> v <*> many_v +-- | One or none. +optional :: (Alt f, Applicative f) => f a -> f (Maybe a) +optional v = Just <$> v <!> pure Nothing + instance (Alt f, Alt g) => Alt (f :*: g) where (as :*: bs) <!> (cs :*: ds) = (as <!> cs) :*: (bs <!> ds) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/semigroupoids-5.2/src/Data/Functor/Apply.hs new/semigroupoids-5.2.2/src/Data/Functor/Apply.hs --- old/semigroupoids-5.2/src/Data/Functor/Apply.hs 2017-04-19 17:14:28.000000000 +0200 +++ new/semigroupoids-5.2.2/src/Data/Functor/Apply.hs 2018-01-18 21:07:06.000000000 +0100 @@ -23,7 +23,6 @@ , Apply(..) , (<..>) -- :: Apply w => w a -> w (a -> b) -> w b - , liftF2 -- :: Apply w => (a -> b -> c) -> w a -> w b -> w c , liftF3 -- :: Apply w => (a -> b -> c -> d) -> w a -> w b -> w c -> w d -- * Wrappers @@ -41,10 +40,6 @@ (<..>) = liftF2 (flip id) {-# INLINE (<..>) #-} --- | Lift a binary function into a comonad with zipping -liftF2 :: Apply w => (a -> b -> c) -> w a -> w b -> w c -liftF2 f a b = f <$> a <.> b -{-# INLINE liftF2 #-} -- | Lift a ternary function into a comonad with zipping liftF3 :: Apply w => (a -> b -> c -> d) -> w a -> w b -> w c -> w d diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/semigroupoids-5.2/src/Data/Functor/Bind/Class.hs new/semigroupoids-5.2.2/src/Data/Functor/Bind/Class.hs --- old/semigroupoids-5.2/src/Data/Functor/Bind/Class.hs 2017-04-19 17:14:28.000000000 +0200 +++ new/semigroupoids-5.2.2/src/Data/Functor/Bind/Class.hs 2018-01-18 21:07:06.000000000 +0100 @@ -80,8 +80,13 @@ import Data.Functor.Extend import Data.List.NonEmpty import Data.Orphans () +import Language.Haskell.TH (Q) import Prelude hiding (id, (.)) +#if MIN_VERSION_base(4,4,0) +import Data.Complex +#endif + #ifdef MIN_VERSION_containers import qualified Data.IntMap as IntMap import Data.IntMap (IntMap) @@ -99,6 +104,11 @@ import Data.Proxy #endif +#ifdef MIN_VERSION_unordered_containers +import Data.Hashable +import Data.HashMap.Lazy (HashMap) +import qualified Data.HashMap.Lazy as HashMap +#endif #ifdef MIN_VERSION_comonad import Control.Comonad @@ -135,6 +145,7 @@ -- @ class Functor f => Apply f where (<.>) :: f (a -> b) -> f a -> f b + (<.>) = liftF2 id -- | @ a '.>' b = 'const' 'id' '<$>' a '<.>' b @ (.>) :: f a -> f b -> f b @@ -144,6 +155,15 @@ (<.) :: f a -> f b -> f a a <. b = const <$> a <.> b + -- | Lift a binary function into a comonad with zipping + liftF2 :: (a -> b -> c) -> f a -> f b -> f c + liftF2 f a b = f <$> a <.> b + {-# INLINE liftF2 #-} + +#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 708 + {-# MINIMAL (<.>) | liftF2 #-} +#endif + #ifdef MIN_VERSION_tagged instance Apply (Tagged a) where (<.>) = (<*>) @@ -255,6 +275,16 @@ (<. ) = (<* ) ( .>) = ( *>) +#if MIN_VERSION_base(4,4,0) +instance Apply Complex where + (a :+ b) <.> (c :+ d) = a c :+ b d +#endif + +-- Applicative Q was only added in template-haskell 2.7 (GHC 7.4), so +-- define in terms of Monad instead. +instance Apply Q where + (<.>) = ap + #ifdef MIN_VERSION_containers -- | A Map is not 'Applicative', but it is an instance of 'Apply' instance Ord k => Apply (Map k) where @@ -277,6 +307,12 @@ ( .>) = ( *>) #endif +#ifdef MIN_VERSION_unordered_containers +-- | A 'HashMap' is not 'Applicative', but it is an instance of 'Apply' +instance (Hashable k, Eq k) => Apply (HashMap k) where + (<.>) = HashMap.intersectionWith id +#endif + -- MaybeT is _not_ the same as Compose f Maybe instance (Functor m, Monad m) => Apply (MaybeT m) where (<.>) = apDefault @@ -477,6 +513,9 @@ instance Bind Identity where (>>-) = (>>=) +instance Bind Q where + (>>-) = (>>=) + instance Bind m => Bind (IdentityT m) where IdentityT m >>- f = IdentityT (m >>- runIdentityT . f) @@ -548,6 +587,14 @@ (>>-) = (>>=) -} +#if MIN_VERSION_base(4,4,0) +instance Bind Complex where + (a :+ b) >>- f = a' :+ b' where + a' :+ _ = f a + _ :+ b' = f b + {-# INLINE (>>-) #-} +#endif + #ifdef MIN_VERSION_containers -- | A 'Map' is not a 'Monad', but it is an instance of 'Bind' instance Ord k => Bind (Map k) where @@ -564,6 +611,17 @@ (>>-) = (>>=) #endif +#ifdef MIN_VERSION_unordered_containers +-- | A 'HashMap' is not a 'Monad', but it is an instance of 'Bind' +instance (Hashable k, Eq k) => Bind (HashMap k) where + -- this is needlessly painful + m >>- f = HashMap.fromList $ do + (k, a) <- HashMap.toList m + case HashMap.lookup k (f a) of + Just b -> [(k,b)] + Nothing -> [] +#endif + infixl 4 <<.>>, <<., .>> class Bifunctor p => Biapply p where diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/semigroupoids-5.2/src/Data/Functor/Bind/Trans.hs new/semigroupoids-5.2.2/src/Data/Functor/Bind/Trans.hs --- old/semigroupoids-5.2/src/Data/Functor/Bind/Trans.hs 2017-04-19 17:14:28.000000000 +0200 +++ new/semigroupoids-5.2.2/src/Data/Functor/Bind/Trans.hs 2018-01-18 21:07:06.000000000 +0100 @@ -31,7 +31,9 @@ import qualified Control.Monad.Trans.Writer.Strict as Strict import Data.Functor.Bind import Data.Orphans () +#if !(MIN_VERSION_base(4,11,0)) import Data.Semigroup hiding (Product) +#endif import Prelude hiding (id, (.)) -- | A subset of monad transformers can transform any 'Bind' as well. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/semigroupoids-5.2/src/Data/Functor/Bind.hs new/semigroupoids-5.2.2/src/Data/Functor/Bind.hs --- old/semigroupoids-5.2/src/Data/Functor/Bind.hs 2017-04-19 17:14:28.000000000 +0200 +++ new/semigroupoids-5.2.2/src/Data/Functor/Bind.hs 2018-01-18 21:07:06.000000000 +0100 @@ -25,7 +25,6 @@ -- * Applyable functors , Apply(..) , (<..>) -- :: Apply w => w a -> w (a -> b) -> w b - , liftF2 -- :: Apply w => (a -> b -> c) -> w a -> w b -> w c , liftF3 -- :: Apply w => (a -> b -> c -> d) -> w a -> w b -> w c -> w d -- * Wrappers , WrappedApplicative(..) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/semigroupoids-5.2/src/Data/Groupoid.hs new/semigroupoids-5.2.2/src/Data/Groupoid.hs --- old/semigroupoids-5.2/src/Data/Groupoid.hs 2017-04-19 17:14:28.000000000 +0200 +++ new/semigroupoids-5.2.2/src/Data/Groupoid.hs 2018-01-18 21:07:06.000000000 +0100 @@ -1,5 +1,6 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE GADTs #-} #if __GLASGOW_HASKELL__ >= 706 {-# LANGUAGE PolyKinds #-} #endif @@ -22,9 +23,27 @@ import Data.Semigroupoid import Data.Semigroupoid.Dual +#if MIN_VERSION_base(4,7,0) +import qualified Data.Type.Coercion as Co +import qualified Data.Type.Equality as Eq +#endif + -- | semigroupoid with inverses. This technically should be a category with inverses, except we need to use Ob to define the valid objects for the category class Semigroupoid k => Groupoid k where inv :: k a b -> k b a instance Groupoid k => Groupoid (Dual k) where inv (Dual k) = Dual (inv k) + +#if MIN_VERSION_base(4,7,0) +instance Groupoid Co.Coercion where + inv = Co.sym + +instance Groupoid (Eq.:~:) where + inv = Eq.sym +#endif + +#if MIN_VERSION_base(4,10,0) +instance Groupoid (Eq.:~~:) where + inv Eq.HRefl = Eq.HRefl +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/semigroupoids-5.2/src/Data/Semigroup/Bitraversable.hs new/semigroupoids-5.2.2/src/Data/Semigroup/Bitraversable.hs --- old/semigroupoids-5.2/src/Data/Semigroup/Bitraversable.hs 2017-04-19 17:14:28.000000000 +0200 +++ new/semigroupoids-5.2.2/src/Data/Semigroup/Bitraversable.hs 2018-01-18 21:07:06.000000000 +0100 @@ -15,7 +15,9 @@ ) where import Control.Applicative +#if !(MIN_VERSION_base(4,11,0)) import Data.Semigroup +#endif import Data.Semigroup.Traversable.Class bifoldMap1Default :: (Bitraversable1 t, Semigroup m) => (a -> m) -> (b -> m) -> t a b -> m diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/semigroupoids-5.2/src/Data/Semigroup/Foldable/Class.hs new/semigroupoids-5.2.2/src/Data/Semigroup/Foldable/Class.hs --- old/semigroupoids-5.2/src/Data/Semigroup/Foldable/Class.hs 2017-04-19 17:14:28.000000000 +0200 +++ new/semigroupoids-5.2.2/src/Data/Semigroup/Foldable/Class.hs 2018-01-18 21:07:06.000000000 +0100 @@ -41,6 +41,10 @@ import Data.Functor.Sum import Data.List.NonEmpty (NonEmpty(..)) +#if MIN_VERSION_base(4,4,0) +import Data.Complex +#endif + #ifdef MIN_VERSION_tagged import Data.Tagged #endif @@ -64,9 +68,11 @@ class Foldable t => Foldable1 t where fold1 :: Semigroup m => t m -> m foldMap1 :: Semigroup m => (a -> m) -> t a -> m + toNonEmpty :: t a -> NonEmpty a foldMap1 f = maybe (error "foldMap1") id . getOption . foldMap (Option . Just . f) fold1 = foldMap1 id + toNonEmpty = foldMap1 (:|[]) instance Foldable1 f => Foldable1 (Rec1 f) where foldMap1 f (Rec1 as) = foldMap1 f as @@ -167,6 +173,12 @@ bifoldMap1 f g = bifoldMap1 f g . unwrapBifunctor {-# INLINE bifoldMap1 #-} +#if MIN_VERSION_base(4,4,0) +instance Foldable1 Complex where + foldMap1 f (a :+ b) = f a <> f b + {-# INLINE foldMap1 #-} +#endif + #ifdef MIN_VERSION_containers instance Foldable1 Tree where foldMap1 f (Node a []) = f a @@ -207,6 +219,7 @@ instance Foldable1 NonEmpty where foldMap1 f (a :| []) = f a foldMap1 f (a :| b : bs) = f a <> foldMap1 f (b :| bs) + toNonEmpty = id instance Foldable1 ((,) a) where foldMap1 f (_, x) = f x diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/semigroupoids-5.2/src/Data/Semigroup/Foldable.hs new/semigroupoids-5.2.2/src/Data/Semigroup/Foldable.hs --- old/semigroupoids-5.2/src/Data/Semigroup/Foldable.hs 2017-04-19 17:14:28.000000000 +0200 +++ new/semigroupoids-5.2.2/src/Data/Semigroup/Foldable.hs 2018-01-18 21:07:06.000000000 +0100 @@ -17,11 +17,14 @@ , sequenceA1_ , foldMapDefault1 , asum1 + , foldrM1 + , foldlM1 ) where import Data.Foldable import Data.Functor.Alt (Alt(..)) import Data.Functor.Apply +import Data.List.NonEmpty (NonEmpty(..)) import Data.Traversable.Instances () import Data.Semigroup hiding (Product, Sum) import Data.Semigroup.Foldable.Class @@ -99,3 +102,30 @@ asum1 :: (Foldable1 t, Alt m) => t (m a) -> m a asum1 = getAlt_ . foldMap1 Alt_ {-# INLINE asum1 #-} + +-- | Monadic fold over the elements of a non-empty structure, +-- associating to the right, i.e. from right to left. +-- +-- > let g = (=<<) . f +-- > in foldrM1 f (x1 :| [x2, ..., xn]) == x1 `g` (x2 `g` ... (xn-1 `f` xn)...) +-- +foldrM1 :: (Foldable1 t, Monad m) => (a -> a -> m a) -> t a -> m a +foldrM1 f = go . toNonEmpty + where + g = (=<<) . f + + go (e:|es) = + case es of + [] -> return e + x:xs -> e `g` (go (x:|xs)) + +-- | Monadic fold over the elements of a non-empty structure, +-- associating to the left, i.e. from left to right. +-- +-- > let g = flip $ (=<<) . f +-- > in foldlM1 f (x1 :| [x2, ..., xn]) == (...((x1 `f` x2) `g` x2) `g`...) `g` xn +-- +foldlM1 :: (Foldable1 t, Monad m) => (a -> a -> m a) -> t a -> m a +foldlM1 f t = foldlM f x xs + where + x:|xs = toNonEmpty t diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/semigroupoids-5.2/src/Data/Semigroup/Traversable/Class.hs new/semigroupoids-5.2.2/src/Data/Semigroup/Traversable/Class.hs --- old/semigroupoids-5.2/src/Data/Semigroup/Traversable/Class.hs 2017-04-19 17:14:28.000000000 +0200 +++ new/semigroupoids-5.2.2/src/Data/Semigroup/Traversable/Class.hs 2018-01-18 21:07:06.000000000 +0100 @@ -47,6 +47,10 @@ #endif import Data.Traversable.Instances () +#if MIN_VERSION_base(4,4,0) +import Data.Complex +#endif + #ifdef MIN_VERSION_containers import Data.Tree #endif @@ -200,6 +204,12 @@ traverse1 f (Functor.InL x) = Functor.InL <$> traverse1 f x traverse1 f (Functor.InR y) = Functor.InR <$> traverse1 f y +#if MIN_VERSION_base(4,4,0) +instance Traversable1 Complex where + traverse1 f (a :+ b) = (:+) <$> f a <.> f b + {-# INLINE traverse1 #-} +#endif + #ifdef MIN_VERSION_tagged instance Traversable1 (Tagged a) where traverse1 f (Tagged a) = Tagged <$> f a diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/semigroupoids-5.2/src/Data/Semigroup/Traversable.hs new/semigroupoids-5.2.2/src/Data/Semigroup/Traversable.hs --- old/semigroupoids-5.2/src/Data/Semigroup/Traversable.hs 2017-04-19 17:14:28.000000000 +0200 +++ new/semigroupoids-5.2.2/src/Data/Semigroup/Traversable.hs 2018-01-18 21:07:06.000000000 +0100 @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- | -- Copyright : (C) 2011-2015 Edward Kmett @@ -14,7 +15,9 @@ ) where import Control.Applicative +#if !(MIN_VERSION_base(4,11,0)) import Data.Semigroup +#endif import Data.Semigroup.Traversable.Class foldMap1Default :: (Traversable1 f, Semigroup m) => (a -> m) -> f a -> m diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/semigroupoids-5.2/src/Data/Semigroupoid.hs new/semigroupoids-5.2.2/src/Data/Semigroupoid.hs --- old/semigroupoids-5.2/src/Data/Semigroupoid.hs 2017-04-19 17:14:28.000000000 +0200 +++ new/semigroupoids-5.2.2/src/Data/Semigroupoid.hs 2018-01-18 21:07:06.000000000 +0100 @@ -1,4 +1,5 @@ {-# LANGUAGE CPP #-} +{-# LANGUAGE GADTs #-} #if __GLASGOW_HASKELL__ >= 706 {-# LANGUAGE PolyKinds #-} @@ -27,6 +28,7 @@ , Semi(..) ) where +import Control.Applicative import Control.Arrow import Data.Functor.Bind import Data.Semigroup @@ -42,6 +44,15 @@ import Control.Comonad #endif +#ifdef MIN_VERSION_tagged +import Data.Tagged (Tagged (..)) +#endif + +#if MIN_VERSION_base(4,7,0) +import qualified Data.Type.Coercion as Co +import qualified Data.Type.Equality as Eq +#endif + -- | 'Control.Category.Category' sans 'Control.Category.id' class Semigroupoid c where o :: c j k -> c i j -> c i k @@ -83,3 +94,24 @@ instance Monoid m => Category (Semi m) where id = Semi mempty Semi m . Semi n = Semi (m `mappend` n) + +instance Semigroupoid Const where + _ `o` Const a = Const a + +#ifdef MIN_VERSION_tagged +instance Semigroupoid Tagged where + Tagged b `o` _ = Tagged b +#endif + +#if MIN_VERSION_base(4,7,0) +instance Semigroupoid Co.Coercion where + o = flip Co.trans + +instance Semigroupoid (Eq.:~:) where + o = flip Eq.trans +#endif + +#if MIN_VERSION_base(4,10,0) +instance Semigroupoid (Eq.:~~:) where + o Eq.HRefl Eq.HRefl = Eq.HRefl +#endif ++++++ semigroupoids.cabal ++++++ name: semigroupoids category: Control, Comonads version: 5.2.2 x-revision: 3 license: BSD3 cabal-version: >= 1.8 license-file: LICENSE author: Edward A. Kmett maintainer: Edward A. Kmett <[email protected]> stability: provisional homepage: http://github.com/ekmett/semigroupoids bug-reports: http://github.com/ekmett/semigroupoids/issues copyright: Copyright (C) 2011-2015 Edward A. Kmett 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 build-type: Custom synopsis: Semigroupoids: Category sans id extra-source-files: .travis.yml .gitignore .vim.custom README.markdown CHANGELOG.markdown Warning.hs description: Provides a wide array of (semi)groupoids and operations for working with them. . A 'Semigroupoid' is a 'Category' without the requirement of identity arrows for every object in the category. . A 'Category' is any 'Semigroupoid' for which the Yoneda lemma holds. . When working with comonads you often have the @\<*\>@ portion of an @Applicative@, but not the @pure@. This was captured in Uustalu and Vene's \"Essence of Dataflow Programming\" in the form of the @ComonadZip@ class in the days before @Applicative@. Apply provides a weaker invariant, but for the comonads used for data flow programming (found in the streams package), this invariant is preserved. Applicative function composition forms a semigroupoid. . Similarly many structures are nearly a comonad, but not quite, for instance lists provide a reasonable 'extend' operation in the form of 'tails', but do not always contain a value. . Ideally the following relationships would hold: . > Foldable ----> Traversable <--- Functor ------> Alt ---------> Plus Semigroupoid > | | | | | > v v v v v > Foldable1 ---> Traversable1 Apply --------> Applicative -> Alternative Category > | | | | > v v v v > Bind ---------> Monad -------> MonadPlus Arrow > . Apply, Bind, and Extend (not shown) give rise the Static, Kleisli and Cokleisli semigroupoids respectively. . This lets us remove many of the restrictions from various monad transformers as in many cases the binding operation or @\<*\>@ operation does not require them. . Finally, to work with these weaker structures it is beneficial to have containers that can provide stronger guarantees about their contents, so versions of 'Traversable' and 'Foldable' that can be folded with just a 'Semigroup' are added. source-repository head type: git location: git://github.com/ekmett/semigroupoids.git custom-setup setup-depends: base >= 4 && < 5, Cabal, cabal-doctest >= 1 && < 1.1 flag containers description: You can disable the use of the `containers` package using `-f-containers`. . Disabing this is an unsupported configuration, but it may be useful for accelerating builds in sandboxes for expert users. default: True manual: True flag contravariant description: You can disable the use of the `contravariant` package using `-f-contravariant`. . Disabling this is an unsupported configuration, but it may be useful for accelerating builds in sandboxes for expert users. . If disabled we will not supply instances of `Contravariant` . default: True manual: True flag distributive description: You can disable the use of the `distributive` package using `-f-distributive`. . Disabling this is an unsupported configuration, but it may be useful for accelerating builds in sandboxes for expert users. . If disabled we will not supply instances of `Distributive` . default: True manual: True flag doctests description: You can disable testing with doctests using `-f-doctests`. default: True manual: True flag comonad description: You can disable the use of the `comonad` package using `-f-comonad`. . Disabling this is an unsupported configuration, but it may be useful for accelerating builds in sandboxes for expert users. . If disabled we will not supply instances of `Comonad` . default: True manual: True flag tagged description: You can disable the use of the `tagged` package using `-f-tagged`. . Disabling this is an unsupported configuration, but it may be useful for accelerating builds in sandboxes for expert users. default: True manual: True flag unordered-containers description: You can disable the use of the `unordered-containers` package (and also its dependency `hashable`) using `-f-unordered-containers`. . Disabling this is an unsupported configuration, but it may be useful for accelerating builds in sandboxes for expert users. default: True manual: True library build-depends: base >= 4.3 && < 5, base-orphans >= 0.5.4 && < 1, bifunctors >= 5 && < 6, semigroups >= 0.8.3.1 && < 1, template-haskell, transformers >= 0.2 && < 0.6, transformers-compat >= 0.5 && < 0.7 if impl(ghc >= 7.0 && < 7.2) build-depends: generic-deriving >= 1.11 && < 1.13 if impl(ghc >= 7.2 && < 7.6) build-depends: ghc-prim if flag(containers) build-depends: containers >= 0.3 && < 0.6 if flag(contravariant) build-depends: contravariant >= 0.2.0.1 && < 2 if flag(distributive) build-depends: distributive >= 0.2.2 && < 1 if flag(comonad) build-depends: comonad >= 4.2.6 && < 6 if flag(tagged) build-depends: tagged >= 0.8.5 && < 1 if flag(unordered-containers) build-depends: hashable >= 1.1 && < 1.3, unordered-containers >= 0.2 && < 0.3 hs-source-dirs: src exposed-modules: Data.Bifunctor.Apply Data.Functor.Alt Data.Functor.Apply Data.Functor.Bind Data.Functor.Bind.Class Data.Functor.Bind.Trans Data.Functor.Extend Data.Functor.Plus Data.Groupoid Data.Isomorphism Data.Semigroup.Bifoldable Data.Semigroup.Bitraversable Data.Semigroup.Foldable Data.Semigroup.Foldable.Class Data.Semigroup.Traversable Data.Semigroup.Traversable.Class Data.Semigroupoid Data.Semigroupoid.Dual Data.Semigroupoid.Ob Data.Semigroupoid.Static Data.Traversable.Instances ghc-options: -Wall -fno-warn-warnings-deprecations test-suite doctests type: exitcode-stdio-1.0 main-is: doctests.hs hs-source-dirs: test ghc-options: -Wall -fno-warn-warnings-deprecations if !flag(doctests) buildable: False else build-depends: base >= 4 && < 5, doctest >= 0.11.1 && < 0.16, semigroupoids
