diff --git a/.travis.yml b/.travis.yml index bd42d46..d1c14d1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ # # For more information, see https://github.com/haskell-CI/haskell-ci # -# version: 0.3.20190429 +# version: 0.3.20190521 # # This file is patched: # - We install the typediff utility from its repoistory. @@ -34,6 +34,9 @@ before_cache: - rm -rfv $CABALHOME/packages/head.hackage matrix: include: + - compiler: ghc-8.8.1 + addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.8.1","cabal-install-3.0"]}} + env: GHCHEAD=true - compiler: ghc-8.6.5 addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.6.5","cabal-install-2.4"]}} - compiler: ghc-8.6.4 @@ -99,6 +102,8 @@ matrix: - compiler: ghc-7.0.1 addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-7.0.1","cabal-install-2.4"]}} env: BATTERIES=NO + allow_failures: + - compiler: ghc-8.8.1 before_install: - HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//') - HCPKG="$HC-pkg" @@ -107,7 +112,7 @@ before_install: - CABALHOME=$HOME/.cabal # install typediff - mkdir -p $HOME/.local/bin - - curl -L https://github.com/haskell-compat/base-compat/releases/download/typediff-0.1.3/typediff > $HOME/.local/bin/typediff + - curl -L https://github.com/haskell-compat/base-compat/releases/download/typediff-0.1.4/typediff > $HOME/.local/bin/typediff - chmod +x $HOME/.local/bin/typediff - export PATH="/opt/ghc/bin:$CABALHOME/bin:$HOME/.local/bin:$PATH" - TOP=$(pwd) @@ -115,24 +120,6 @@ before_install: - echo $HCNUMVER - CABAL="$CABAL -vnormal+nowrap+markoutput" - set -o pipefail - - | - echo 'function blue(s) { printf "\033[0;34m" s "\033[0m " }' >> .colorful.awk - echo 'BEGIN { state = "output"; }' >> .colorful.awk - echo '/^-----BEGIN CABAL OUTPUT-----$/ { state = "cabal" }' >> .colorful.awk - echo '/^-----END CABAL OUTPUT-----$/ { state = "output" }' >> .colorful.awk - echo '!/^(-----BEGIN CABAL OUTPUT-----|-----END CABAL OUTPUT-----)/ {' >> .colorful.awk - echo ' if (state == "cabal") {' >> .colorful.awk - echo ' print blue($0)' >> .colorful.awk - echo ' } else {' >> .colorful.awk - echo ' print $0' >> .colorful.awk - echo ' }' >> .colorful.awk - echo '}' >> .colorful.awk - - cat .colorful.awk - - | - color_cabal_output () { - awk -f $TOP/.colorful.awk - } - - echo text | color_cabal_output install: - ${CABAL} --version - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]" @@ -156,6 +143,18 @@ install: echo " prefix: $CABALHOME" >> $CABALHOME/config echo "repository hackage.haskell.org" >> $CABALHOME/config echo " url: http://hackage.haskell.org/" >> $CABALHOME/config + - | + if $GHCHEAD; then + echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1/g')" >> $CABALHOME/config + + echo "repository head.hackage" >> $CABALHOME/config + echo " url: http://head.hackage.haskell.org/" >> $CABALHOME/config + echo " secure: True" >> $CABALHOME/config + echo " root-keys: 07c59cb65787dedfaef5bd5f987ceb5f7e5ebf88b904bbd4c5cbdeb2ff71b740" >> $CABALHOME/config + echo " 2e8555dde16ebd8df076f1a8ef13b8f14c66bad8eafefd7d9e37d0ed711821fb" >> $CABALHOME/config + echo " 8f79fd2389ab2967354407ec852cbe73f2e8635793ac446d09461ffb99527f6e" >> $CABALHOME/config + echo " key-threshold: 3" >> $CABALHOME/config + fi - cat $CABALHOME/config - rm -fv cabal.project cabal.project.local cabal.project.freeze - travis_retry ${CABAL} v2-update -v @@ -173,15 +172,15 @@ install: - if [ -f "./base-compat/configure.ac" ]; then (cd "./base-compat" && autoreconf -i); fi - if [ -f "./base-compat-batteries/configure.ac" ]; then (cd "./base-compat-batteries" && autoreconf -i); fi - if [ -f "./check/configure.ac" ]; then (cd "./check" && autoreconf -i); fi - - ${CABAL} v2-freeze -w ${HC} ${TEST} ${BENCH} | color_cabal_output + - ${CABAL} v2-freeze -w ${HC} ${TEST} ${BENCH} - "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'" - rm cabal.project.freeze - - travis_wait ${CABAL} v2-build -w ${HC} ${TEST} ${BENCH} --dep -j2 all | color_cabal_output - - travis_wait ${CABAL} v2-build -w ${HC} --disable-tests --disable-benchmarks --dep -j2 all | color_cabal_output + - travis_wait ${CABAL} v2-build -w ${HC} ${TEST} ${BENCH} --dep -j2 all + - travis_wait ${CABAL} v2-build -w ${HC} --disable-tests --disable-benchmarks --dep -j2 all script: - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX) # Packaging... - - ${CABAL} v2-sdist all | color_cabal_output + - ${CABAL} v2-sdist all # Unpacking... - mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/ - cd ${DISTDIR} || false @@ -199,21 +198,21 @@ script: - cat cabal.project.local || true # Building... # this builds all libraries and executables (without tests/benchmarks) - - ${CABAL} v2-build -w ${HC} --disable-tests --disable-benchmarks all | color_cabal_output + - ${CABAL} v2-build -w ${HC} --disable-tests --disable-benchmarks all # Building with tests and benchmarks... # build & run tests, build benchmarks - - ${CABAL} v2-build -w ${HC} ${TEST} ${BENCH} all | color_cabal_output + - ${CABAL} v2-build -w ${HC} ${TEST} ${BENCH} all # Testing... - - if [ $HCNUMVER -ge 70002 ] && [ $HCNUMVER -lt 70201 ] || [ $HCNUMVER -ge 70202 ] && [ $HCNUMVER -lt 70401 ] || [ $HCNUMVER -ge 70402 ] && [ $HCNUMVER -lt 70801 ] || [ $HCNUMVER -ge 70802 ] ; then ${CABAL} v2-test -w ${HC} ${TEST} ${BENCH} all | color_cabal_output ; fi + - if [ $HCNUMVER -ge 70002 ] && [ $HCNUMVER -lt 70201 ] || [ $HCNUMVER -ge 70202 ] && [ $HCNUMVER -lt 70401 ] || [ $HCNUMVER -ge 70402 ] && [ $HCNUMVER -lt 70801 ] || [ $HCNUMVER -ge 70802 ] ; then ${CABAL} v2-test -w ${HC} ${TEST} ${BENCH} all ; fi # cabal check... - (cd base-compat-* && ${CABAL} -vnormal check) - if [ ! "x$BATTERIES" = "xNO" ] ; then (cd base-compat-batteries-* && ${CABAL} -vnormal check) ; fi - if [ ! "x$BATTERIES" = "xNO" ] ; then (cd type-check-* && ${CABAL} -vnormal check) ; fi # haddock... - - ${CABAL} v2-haddock -w ${HC} ${TEST} ${BENCH} all | color_cabal_output + - ${CABAL} v2-haddock -w ${HC} ${TEST} ${BENCH} all # Building without installed constraints for packages in global-db... - rm -f cabal.project.local - - ${CABAL} v2-build -w ${HC} --disable-tests --disable-benchmarks all | color_cabal_output + - ${CABAL} v2-build -w ${HC} --disable-tests --disable-benchmarks all # REGENDATA ["--output=.travis.yml","--config=cabal.haskell-ci","cabal.project"] # EOF diff --git a/base-compat-batteries/CHANGES.markdown b/base-compat-batteries/CHANGES.markdown index 1cbda79..2c3f6a0 100644 --- a/base-compat-batteries/CHANGES.markdown +++ b/base-compat-batteries/CHANGES.markdown @@ -1,3 +1,36 @@ +## Changes in 0.11.0 [????.??.??] + - Reexport `MonadFail(fail)` from `Prelude.Compat` and `Control.Monad.Compat`. + + Because `Prelude.Compat.fail` now corresponds to the `fail` from `MonadFail` + instead of `Monad`, some care is required to implement `Monad.fail` on + pre-8.8 versions of GHC. The following template is recommended: + + ```haskell + import Prelude.Compat + #if !(MIN_VERSION_base(4,13,0)) + import qualified Control.Monad + #endif + + data Blah a = ... + + instance Functor Blah where ... + instance Applicative Blah where ... + + instance Monad Blah where + (>>=) = ... + #if !(MIN_VERSION_base(4,13,0)) + fail = fail -- The RHS fail corresponds to MonadFail.fail, + -- /not/ Monad.fail + #endif + + instance MonadFail Blah where + fail = ... + ``` + + - This coincides with the `base-compat-???` release. Refer to the + [`base-compat` changelog](https://github.com/haskell-compat/base-compat/blob/master/base-compat/CHANGES.markdown#changes-in-????-????????) + for more details. + ## Changes in 0.10.5 [2018.10.18] - This coincides with the `base-compat-0.10.5` release. Refer to the [`base-compat` changelog](https://github.com/haskell-compat/base-compat/blob/master/base-compat/CHANGES.markdown#changes-in-0105-20181018) diff --git a/base-compat-batteries/base-compat-batteries.cabal b/base-compat-batteries/base-compat-batteries.cabal index e18f57d..be1fedd 100644 --- a/base-compat-batteries/base-compat-batteries.cabal +++ b/base-compat-batteries/base-compat-batteries.cabal @@ -1,5 +1,5 @@ name: base-compat-batteries -version: 0.10.5 +version: 0.11.0 license: MIT license-file: LICENSE copyright: (c) 2012-2018 Simon Hengel, @@ -44,6 +44,7 @@ tested-with: GHC == 7.0.* , GHC == 8.2.* , GHC == 8.4.* , GHC == 8.6.* + , GHC == 8.8.* extra-source-files: CHANGES.markdown, README.markdown source-repository head @@ -56,7 +57,7 @@ library -Wall build-depends: base >= 4.3 && < 5, - base-compat == 0.10.5 + base-compat == 0.11.0 if !impl(ghc >= 7.8) build-depends: tagged >= 0.8.5 && < 0.9 diff --git a/base-compat-batteries/src/Control/Monad/Compat.hs b/base-compat-batteries/src/Control/Monad/Compat.hs index 351f434..584e676 100644 --- a/base-compat-batteries/src/Control/Monad/Compat.hs +++ b/base-compat-batteries/src/Control/Monad/Compat.hs @@ -1,6 +1,8 @@ {-# LANGUAGE CPP, NoImplicitPrelude, PackageImports #-} module Control.Monad.Compat ( module Base - ) where +, fail +) where -import "base-compat" Control.Monad.Compat as Base +import "base-compat" Control.Monad.Compat as Base hiding (fail) +import Control.Monad.Fail (fail) diff --git a/base-compat-batteries/src/Prelude/Compat.hs b/base-compat-batteries/src/Prelude/Compat.hs index ec77756..0c5034f 100644 --- a/base-compat-batteries/src/Prelude/Compat.hs +++ b/base-compat-batteries/src/Prelude/Compat.hs @@ -2,12 +2,17 @@ module Prelude.Compat ( module Base #if !(MIN_VERSION_base(4,9,0)) +, Fail.MonadFail(Fail.fail) , Semi.Semigroup((Semi.<>)) #endif ) where import "base-compat" Prelude.Compat as Base +#if !(MIN_VERSION_base(4,9,0)) + hiding (fail) +#endif #if !(MIN_VERSION_base(4,9,0)) +import "fail" Control.Monad.Fail as Fail import "semigroups" Data.Semigroup as Semi #endif diff --git a/base-compat/CHANGES.markdown b/base-compat/CHANGES.markdown index 8532071..721dd43 100644 --- a/base-compat/CHANGES.markdown +++ b/base-compat/CHANGES.markdown @@ -1,3 +1,41 @@ +## Changes in 0.11.0 [????.??.??] + - Sync with `base-4.13`/GHC 8.8 + - Backport `MonadFail(fail)` to `Prelude.Compat` and `Control.Monad.Compat`. + + Because `Prelude.Compat.fail` now corresponds to the `fail` from `MonadFail` + instead of `Monad`, some care is required to implement `Monad.fail` on + pre-8.8 versions of GHC. The following template is recommended: + + ```haskell + import Prelude.Compat + #if !(MIN_VERSION_base(4,13,0)) + import qualified Control.Monad + #endif + + data Blah a = ... + + instance Functor Blah where ... + instance Applicative Blah where ... + + instance Monad Blah where + (>>=) = ... + #if !(MIN_VERSION_base(4,13,0)) + fail = fail -- The RHS fail corresponds to MonadFail.fail, + -- /not/ Monad.fail + #endif + + instance MonadFail Blah where + fail = ... + ``` + + Note that the `MonadFail` class has only been in `base` since + `base-4.9`/GHC 8.0, so accordingly, this can only be backported back + to GHC 8.0. If you wish to have a version of + `Prelude.Compat`/`Control.Monad.Compat` that backports + `MonadFail` to older GHCs (by conditionally depending on the `fail` + library), use the `Prelude.Compat`/`Control.Monad.Compat` modules from the + `base-compat-batteries` package. + ## Changes in 0.10.5 [2018.10.18] - Enable `BangPatterns` in `Prelude.Compat`. diff --git a/base-compat/README.markdown b/base-compat/README.markdown index 7d0a2ad..fc4b927 100644 --- a/base-compat/README.markdown +++ b/base-compat/README.markdown @@ -302,6 +302,8 @@ on, paired with the things that each library backports: ## Supported versions of GHC/`base` + * `ghc-8.8.1` / `base-4.13.0.0` + * `ghc-8.6.5` / `base-4.12.0.0` * `ghc-8.6.4` / `base-4.12.0.0` * `ghc-8.6.3` / `base-4.12.0.0` * `ghc-8.6.2` / `base-4.12.0.0` diff --git a/base-compat/base-compat.cabal b/base-compat/base-compat.cabal index e9f27be..414074c 100644 --- a/base-compat/base-compat.cabal +++ b/base-compat/base-compat.cabal @@ -1,5 +1,5 @@ name: base-compat -version: 0.10.5 +version: 0.11.0 license: MIT license-file: LICENSE copyright: (c) 2012-2018 Simon Hengel, @@ -53,6 +53,7 @@ tested-with: GHC == 7.0.* , GHC == 8.2.* , GHC == 8.4.* , GHC == 8.6.* + , GHC == 8.8.* extra-source-files: CHANGES.markdown, README.markdown source-repository head diff --git a/base-compat/src/Control/Monad/Compat.hs b/base-compat/src/Control/Monad/Compat.hs index 543c19a..e6b25d1 100644 --- a/base-compat/src/Control/Monad/Compat.hs +++ b/base-compat/src/Control/Monad/Compat.hs @@ -1,7 +1,11 @@ {-# LANGUAGE CPP, NoImplicitPrelude #-} module Control.Monad.Compat ( module Base -, Monad(..) +, Monad +#if MIN_VERSION_base(4,9,0) +, MonadFail +#endif +, fail , MonadPlus(..) #if !(MIN_VERSION_base(4,8,0)) , foldM @@ -31,7 +35,8 @@ module Control.Monad.Compat ( ) where #if MIN_VERSION_base(4,9,0) -import Control.Monad as Base +import Control.Monad as Base hiding (fail) +import Control.Monad.Fail as Base #else import Control.Monad as Base hiding ( forever diff --git a/base-compat/src/Prelude/Compat.hs b/base-compat/src/Prelude/Compat.hs index 8956cb5..365d66d 100644 --- a/base-compat/src/Prelude/Compat.hs +++ b/base-compat/src/Prelude/Compat.hs @@ -235,6 +235,9 @@ module Prelude.Compat ( , Functor , Integral , Monad +#if MIN_VERSION_base(4,9,0) +, MonadFail +#endif , Monoid , Num (fromInteger) , Ord @@ -274,10 +277,14 @@ module Prelude.Compat ( #if MIN_VERSION_base(4,9,0) -import Prelude as Base -# if MIN_VERSION_base(4,10,0) && !(MIN_VERSION_base(4,12,0)) - hiding (($!)) +import Prelude as Base hiding ( +# if !(MIN_VERSION_base(4,13,0)) + fail +# if MIN_VERSION_base(4,10,0) && !(MIN_VERSION_base(4,12,0)) + , ($!) +# endif # endif + ) #else @@ -322,6 +329,10 @@ import Data.Word import Data.Semigroup as Base (Semigroup((<>))) #endif +#if MIN_VERSION_base(4,9,0) && !(MIN_VERSION_base(4,13,0)) +import Control.Monad.Fail as Base (MonadFail(fail)) +#endif + #if MIN_VERSION_base(4,10,0) && !(MIN_VERSION_base(4,12,0)) import GHC.Exts (TYPE) #endif diff --git a/cabal.haskell-ci b/cabal.haskell-ci index d9867aa..88a96ac 100644 --- a/cabal.haskell-ci +++ b/cabal.haskell-ci @@ -6,3 +6,5 @@ env: 7.0.1:BATTERIES=NO, -- TODO: Have `BATTERIES=NO` imply no tests tests: (>=7.0.2 && <7.2.1) || (>=7.2.2 && <7.4.1) || (>=7.4.2 && <7.8.1) || >=7.8.2 travis-patches: travis.yml.patch +-- travis_wait interacts poorly with color_cabal_output +color: False diff --git a/check/lib/Util.hs b/check/lib/Util.hs index b932e8f..355208c 100644 --- a/check/lib/Util.hs +++ b/check/lib/Util.hs @@ -115,7 +115,8 @@ normalizeSignatures -- something that we shouldn't. -- _ <- P.choice - [ P.try (P.string "ghc-prim") + [ P.try (P.string "fail") + , P.try (P.string "ghc-prim") , P.try (P.string "semigroups") ] diff --git a/check/type-check.cabal b/check/type-check.cabal index 8803013..a438e0d 100644 --- a/check/type-check.cabal +++ b/check/type-check.cabal @@ -7,7 +7,7 @@ version: 0.1.0 synopsis: Checks that exported type signatures match what's expected description: Checks that exported type signatures match what's expected. - + author: Simon Hengel , João Cristóvão , @@ -38,6 +38,7 @@ tested-with: GHC == 7.0.* , GHC == 8.2.* , GHC == 8.4.* , GHC == 8.6.* + , GHC == 8.8.* library exposed-modules: TypeDump @@ -75,7 +76,7 @@ executable dumptypes -- Run with -- (cd check && cabal new-run dumpindex Control.Monad.Compat) --- +-- executable dumpindex default-language: Haskell2010 hs-source-dirs: exes diff --git a/check/types/Control.Monad.Compat.types b/check/types/Control.Monad.Compat.types index d64337d..9cfce40 100644 --- a/check/types/Control.Monad.Compat.types +++ b/check/types/Control.Monad.Compat.types @@ -5,7 +5,7 @@ (>>=) :: Monad m => m a -> (a -> m b) -> m b (>>) :: Monad m => m a -> m b -> m b ap :: Monad m => m (a -> b) -> m a -> m b -fail :: Monad m => GHC.Base.String -> m a +fail :: MonadFail m => GHC.Base.String -> m a filterM :: GHC.Base.Applicative m => (a -> m GHC.Types.Bool) -> [a] -> m [a] fmap :: Functor f => (a -> b) -> f a -> f b foldM :: (Data.Foldable.Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b @@ -23,17 +23,17 @@ liftM5 :: Monad m => (a1 -> a2 -> a3 -> a4 -> a5 -> r) -> m a1 -> m a2 -> mapAndUnzipM :: GHC.Base.Applicative m => (a -> m (b, c)) -> [a] -> m ([b], [c]) mapM :: (Data.Traversable.Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM_ :: (Data.Foldable.Foldable t, Monad m) => (a -> m b) -> t a -> m () -mfilter :: MonadPlus m => (a -> GHC.Types.Bool) -> m a -> m a +mfilter :: MonadPlus m => (a -> GHC.Types.Bool) -> m a -> m a mplus :: MonadPlus m => m a -> m a -> m a msum :: (Data.Foldable.Foldable t, MonadPlus m) => t (m a) -> m a mzero :: MonadPlus m => m a -replicateM :: GHC.Base.Applicative m => GHC.Types.Int -> m a -> m [a] -replicateM_ :: GHC.Base.Applicative m => GHC.Types.Int -> m a -> m () +replicateM :: GHC.Base.Applicative m => GHC.Types.Int -> m a -> m [a] +replicateM_ :: GHC.Base.Applicative m => GHC.Types.Int -> m a -> m () return :: Monad m => a -> m a sequence :: (Data.Traversable.Traversable t, Monad m) => t (m a) -> m (t a) sequence_ :: (Data.Foldable.Foldable t, Monad m) => t (m a) -> m () -unless :: GHC.Base.Applicative f => GHC.Types.Bool -> f () -> f () +unless :: GHC.Base.Applicative f => GHC.Types.Bool -> f () -> f () void :: Functor f => f a -> f () -when :: GHC.Base.Applicative f => GHC.Types.Bool -> f () -> f () +when :: GHC.Base.Applicative f => GHC.Types.Bool -> f () -> f () zipWithM :: GHC.Base.Applicative m => (a -> b -> m c) -> [a] -> [b] -> m [c] zipWithM_ :: GHC.Base.Applicative m => (a -> b -> m c) -> [a] -> [b] -> m () diff --git a/check/types/Data.Foldable.Compat.types b/check/types/Data.Foldable.Compat.types index e39ff89..0458ed4 100644 --- a/check/types/Data.Foldable.Compat.types +++ b/check/types/Data.Foldable.Compat.types @@ -1,11 +1,11 @@ -all :: Foldable t => (a -> GHC.Types.Bool) -> t a -> GHC.Types.Bool -and :: Foldable t => t GHC.Types.Bool -> GHC.Types.Bool -any :: Foldable t => (a -> GHC.Types.Bool) -> t a -> GHC.Types.Bool +all :: Foldable t => (a -> GHC.Types.Bool) -> t a -> GHC.Types.Bool +and :: Foldable t => t GHC.Types.Bool -> GHC.Types.Bool +any :: Foldable t => (a -> GHC.Types.Bool) -> t a -> GHC.Types.Bool asum :: (Foldable t, GHC.Base.Alternative f) => t (f a) -> f a concat :: Foldable t => t [a] -> [a] concatMap :: Foldable t => (a -> [b]) -> t a -> [b] -elem :: (Foldable t, GHC.Classes.Eq a) => a -> t a -> GHC.Types.Bool -find :: Foldable t => (a -> GHC.Types.Bool) -> t a -> GHC.Base.Maybe a +elem :: (Foldable t, GHC.Classes.Eq a) => a -> t a -> GHC.Types.Bool +find :: Foldable t => (a -> GHC.Types.Bool) -> t a -> GHC.Maybe.Maybe a fold :: (Foldable t, GHC.Base.Monoid m) => t m -> m foldl :: Foldable t => (b -> a -> b) -> b -> t a -> b foldl' :: Foldable t => (b -> a -> b) -> b -> t a -> b @@ -21,13 +21,13 @@ forM_ :: (Foldable t, GHC.Base.Monad m) => t a -> (a -> m b) -> m () length :: Foldable t => t a -> GHC.Types.Int mapM_ :: (Foldable t, GHC.Base.Monad m) => (a -> m b) -> t a -> m () maximum :: (Foldable t, GHC.Classes.Ord a) => t a -> a -maximumBy :: Foldable t => (a -> a -> GHC.Types.Ordering) -> t a -> a +maximumBy :: Foldable t => (a -> a -> GHC.Types.Ordering) -> t a -> a minimum :: (Foldable t, GHC.Classes.Ord a) => t a -> a -minimumBy :: Foldable t => (a -> a -> GHC.Types.Ordering) -> t a -> a +minimumBy :: Foldable t => (a -> a -> GHC.Types.Ordering) -> t a -> a msum :: (Foldable t, GHC.Base.MonadPlus m) => t (m a) -> m a -notElem :: (Foldable t, GHC.Classes.Eq a) => a -> t a -> GHC.Types.Bool +notElem :: (Foldable t, GHC.Classes.Eq a) => a -> t a -> GHC.Types.Bool null :: Foldable t => t a -> GHC.Types.Bool -or :: Foldable t => t GHC.Types.Bool -> GHC.Types.Bool +or :: Foldable t => t GHC.Types.Bool -> GHC.Types.Bool product :: (Foldable t, GHC.Num.Num a) => t a -> a sequence_ :: (Foldable t, GHC.Base.Monad m) => t (m a) -> m () sequenceA_ :: (Foldable t, GHC.Base.Applicative f) => t (f a) -> f () diff --git a/check/types/Data.List.Compat.types b/check/types/Data.List.Compat.types index d3e9cc1..f9b61a4 100644 --- a/check/types/Data.List.Compat.types +++ b/check/types/Data.List.Compat.types @@ -1,9 +1,9 @@ (!!) :: [a] -> GHC.Types.Int -> a (\\) :: GHC.Classes.Eq a => [a] -> [a] -> [a] (++) :: [a] -> [a] -> [a] -all :: Data.Foldable.Foldable t => (a -> GHC.Types.Bool) -> t a -> GHC.Types.Bool -and :: Data.Foldable.Foldable t => t GHC.Types.Bool -> GHC.Types.Bool -any :: Data.Foldable.Foldable t => (a -> GHC.Types.Bool) -> t a -> GHC.Types.Bool +all :: Data.Foldable.Foldable t => (a -> GHC.Types.Bool) -> t a -> GHC.Types.Bool +and :: Data.Foldable.Foldable t => t GHC.Types.Bool -> GHC.Types.Bool +any :: Data.Foldable.Foldable t => (a -> GHC.Types.Bool) -> t a -> GHC.Types.Bool break :: (a -> GHC.Types.Bool) -> [a] -> ([a], [a]) concat :: Data.Foldable.Foldable t => t [a] -> [a] concatMap :: Data.Foldable.Foldable t => (a -> [b]) -> t a -> [b] @@ -15,12 +15,12 @@ drop :: GHC.Types.Int -> [a] -> [a] dropWhile :: (a -> GHC.Types.Bool) -> [a] -> [a] dropWhileEnd :: (a -> GHC.Types.Bool) -> [a] -> [a] elem :: (Data.Foldable.Foldable t, GHC.Classes.Eq a) => a -> t a -> GHC.Types.Bool -elemIndex :: GHC.Classes.Eq a => a -> [a] -> GHC.Base.Maybe GHC.Types.Int -elemIndices :: GHC.Classes.Eq a => a -> [a] -> [GHC.Types.Int] +elemIndex :: GHC.Classes.Eq a => a -> [a] -> GHC.Maybe.Maybe GHC.Types.Int +elemIndices :: GHC.Classes.Eq a => a -> [a] -> [GHC.Types.Int] filter :: (a -> GHC.Types.Bool) -> [a] -> [a] -find :: Data.Foldable.Foldable t => (a -> GHC.Types.Bool) -> t a -> GHC.Base.Maybe a -findIndex :: (a -> GHC.Types.Bool) -> [a] -> GHC.Base.Maybe GHC.Types.Int -findIndices :: (a -> GHC.Types.Bool) -> [a] -> [GHC.Types.Int] +find :: Data.Foldable.Foldable t => (a -> GHC.Types.Bool) -> t a -> GHC.Maybe.Maybe a +findIndex :: (a -> GHC.Types.Bool) -> [a] -> GHC.Maybe.Maybe GHC.Types.Int +findIndices :: (a -> GHC.Types.Bool) -> [a] -> [GHC.Types.Int] foldl :: Data.Foldable.Foldable t => (b -> a -> b) -> b -> t a -> b foldl' :: Data.Foldable.Foldable t => (b -> a -> b) -> b -> t a -> b foldl1 :: Data.Foldable.Foldable t => (a -> a -> a) -> t a -> a @@ -44,28 +44,28 @@ intercalate :: [a] -> [[a]] -> [a] intersect :: GHC.Classes.Eq a => [a] -> [a] -> [a] intersectBy :: (a -> a -> GHC.Types.Bool) -> [a] -> [a] -> [a] intersperse :: a -> [a] -> [a] -isInfixOf :: GHC.Classes.Eq a => [a] -> [a] -> GHC.Types.Bool -isPrefixOf :: GHC.Classes.Eq a => [a] -> [a] -> GHC.Types.Bool -isSubsequenceOf :: GHC.Classes.Eq a => [a] -> [a] -> GHC.Types.Bool -isSuffixOf :: GHC.Classes.Eq a => [a] -> [a] -> GHC.Types.Bool +isInfixOf :: GHC.Classes.Eq a => [a] -> [a] -> GHC.Types.Bool +isPrefixOf :: GHC.Classes.Eq a => [a] -> [a] -> GHC.Types.Bool +isSubsequenceOf :: GHC.Classes.Eq a => [a] -> [a] -> GHC.Types.Bool +isSuffixOf :: GHC.Classes.Eq a => [a] -> [a] -> GHC.Types.Bool iterate :: (a -> a) -> a -> [a] iterate' :: (a -> a) -> a -> [a] last :: [a] -> a length :: Data.Foldable.Foldable t => t a -> GHC.Types.Int lines :: GHC.Base.String -> [GHC.Base.String] -lookup :: GHC.Classes.Eq a => a -> [(a, b)] -> GHC.Base.Maybe b +lookup :: GHC.Classes.Eq a => a -> [(a, b)] -> GHC.Maybe.Maybe b map :: (a -> b) -> [a] -> [b] mapAccumL :: Data.Traversable.Traversable t => (a -> b -> (a, c)) -> a -> t b -> (a, t c) mapAccumR :: Data.Traversable.Traversable t => (a -> b -> (a, c)) -> a -> t b -> (a, t c) -maximum :: (Data.Foldable.Foldable t, GHC.Classes.Ord a) => t a -> a +maximum :: (Data.Foldable.Foldable t, GHC.Classes.Ord a) => t a -> a maximumBy :: Data.Foldable.Foldable t => (a -> a -> GHC.Types.Ordering) -> t a -> a -minimum :: (Data.Foldable.Foldable t, GHC.Classes.Ord a) => t a -> a +minimum :: (Data.Foldable.Foldable t, GHC.Classes.Ord a) => t a -> a minimumBy :: Data.Foldable.Foldable t => (a -> a -> GHC.Types.Ordering) -> t a -> a notElem :: (Data.Foldable.Foldable t, GHC.Classes.Eq a) => a -> t a -> GHC.Types.Bool nub :: GHC.Classes.Eq a => [a] -> [a] nubBy :: (a -> a -> GHC.Types.Bool) -> [a] -> [a] null :: Data.Foldable.Foldable t => t a -> GHC.Types.Bool -or :: Data.Foldable.Foldable t => t GHC.Types.Bool -> GHC.Types.Bool +or :: Data.Foldable.Foldable t => t GHC.Types.Bool -> GHC.Types.Bool partition :: (a -> GHC.Types.Bool) -> [a] -> ([a], [a]) permutations :: [a] -> [[a]] product :: (Data.Foldable.Foldable t, GHC.Num.Num a) => t a -> a @@ -82,7 +82,7 @@ sortBy :: (a -> a -> GHC.Types.Ordering) -> [a] -> [a] sortOn :: GHC.Classes.Ord b => (a -> b) -> [a] -> [a] span :: (a -> GHC.Types.Bool) -> [a] -> ([a], [a]) splitAt :: GHC.Types.Int -> [a] -> ([a], [a]) -stripPrefix :: GHC.Classes.Eq a => [a] -> [a] -> GHC.Base.Maybe [a] +stripPrefix :: GHC.Classes.Eq a => [a] -> [a] -> GHC.Maybe.Maybe [a] subsequences :: [a] -> [[a]] sum :: (Data.Foldable.Foldable t, GHC.Num.Num a) => t a -> a tail :: [a] -> [a] @@ -90,8 +90,8 @@ tails :: [a] -> [[a]] take :: GHC.Types.Int -> [a] -> [a] takeWhile :: (a -> GHC.Types.Bool) -> [a] -> [a] transpose :: [[a]] -> [[a]] -uncons :: [a] -> GHC.Base.Maybe (a, [a]) -unfoldr :: (b -> GHC.Base.Maybe (a, b)) -> b -> [a] +uncons :: [a] -> GHC.Maybe.Maybe (a, [a]) +unfoldr :: (b -> GHC.Maybe.Maybe (a, b)) -> b -> [a] union :: GHC.Classes.Eq a => [a] -> [a] -> [a] unionBy :: (a -> a -> GHC.Types.Bool) -> [a] -> [a] -> [a] unlines :: [GHC.Base.String] -> GHC.Base.String diff --git a/check/types/Data.Monoid.Compat.types b/check/types/Data.Monoid.Compat.types index 3aa9309..069fd91 100644 --- a/check/types/Data.Monoid.Compat.types +++ b/check/types/Data.Monoid.Compat.types @@ -1,18 +1,18 @@ -(<>) :: Data.Semigroup.Semigroup a => a -> a -> a +(<>) :: GHC.Base.Semigroup a => a -> a -> a All :: GHC.Types.Bool -> All Any :: GHC.Types.Bool -> Any appEndo :: Endo a -> a -> a Dual :: a -> Dual a Endo :: (a -> a) -> Endo a -First :: GHC.Base.Maybe a -> First a +First :: GHC.Maybe.Maybe a -> First a getAll :: All -> GHC.Types.Bool getAny :: Any -> GHC.Types.Bool getDual :: Dual a -> a -getFirst :: First a -> GHC.Base.Maybe a -getLast :: Last a -> GHC.Base.Maybe a +getFirst :: First a -> GHC.Maybe.Maybe a +getLast :: Last a -> GHC.Maybe.Maybe a getProduct :: Product a -> a getSum :: Sum a -> a -Last :: GHC.Base.Maybe a -> Last a +Last :: GHC.Maybe.Maybe a -> Last a mappend :: Monoid a => a -> a -> a mconcat :: Monoid a => [a] -> a mempty :: Monoid a => a diff --git a/check/types/Prelude.Compat.types b/check/types/Prelude.Compat.types index ddbc9f3..bcc5bf3 100644 --- a/check/types/Prelude.Compat.types +++ b/check/types/Prelude.Compat.types @@ -68,7 +68,7 @@ errorWithoutStackTrace :: [Char] -> a even :: Integral a => a -> Bool exp :: Floating a => a -> a exponent :: RealFloat a => a -> Int -fail :: Monad m => String -> m a +fail :: MonadFail m => String -> m a False :: Bool filter :: (a -> Bool) -> [a] -> [a] flip :: (a -> b -> c) -> b -> a -> c diff --git a/travis.yml.patch b/travis.yml.patch index 6ae9a0d..1e2d221 100644 --- a/travis.yml.patch +++ b/travis.yml.patch @@ -1,10 +1,10 @@ diff --git a/.travis.yml b/.travis.yml -index 0133546..d677f11 100644 +index 7f5a7b2..d1c14d1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,14 @@ # - # version: 0.3.20190418 + # version: 0.3.20190521 # +# This file is patched: +# - We install the typediff utility from its repoistory. @@ -17,20 +17,29 @@ index 0133546..d677f11 100644 language: c dist: xenial git: -@@ -96,7 +104,11 @@ before_install: +@@ -102,7 +110,11 @@ before_install: - unset CC - CABAL=/opt/ghc/bin/cabal - CABALHOME=$HOME/.cabal - - export PATH="$CABALHOME/bin:$PATH" + # install typediff + - mkdir -p $HOME/.local/bin -+ - curl -L https://github.com/haskell-compat/base-compat/releases/download/typediff-0.1.3/typediff > $HOME/.local/bin/typediff ++ - curl -L https://github.com/haskell-compat/base-compat/releases/download/typediff-0.1.4/typediff > $HOME/.local/bin/typediff + - chmod +x $HOME/.local/bin/typediff + - export PATH="/opt/ghc/bin:$CABALHOME/bin:$HOME/.local/bin:$PATH" - TOP=$(pwd) - HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') )) - echo $HCNUMVER -@@ -150,8 +162,7 @@ install: +@@ -134,7 +146,7 @@ install: + - | + if $GHCHEAD; then + echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1/g')" >> $CABALHOME/config +- ++ + echo "repository head.hackage" >> $CABALHOME/config + echo " url: http://head.hackage.haskell.org/" >> $CABALHOME/config + echo " secure: True" >> $CABALHOME/config +@@ -151,8 +163,7 @@ install: - touch cabal.project - | echo 'packages: "./base-compat"' >> cabal.project @@ -39,19 +48,19 @@ index 0133546..d677f11 100644 + if [ ! "x$BATTERIES" = "xNO" ] ; then (echo 'packages: "./base-compat-batteries"' >> cabal.project; echo 'packages: "./check"' >> cabal.project) ; fi - | echo "write-ghc-environment-files: always" >> cabal.project - - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^(base-compat|base-compat-batteries|type-check)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done" -@@ -163,8 +174,8 @@ install: - - ${CABAL} v2-freeze -w ${HC} ${TEST} ${BENCH} | color_cabal_output + - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(base-compat|base-compat-batteries|type-check)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done" +@@ -164,8 +175,8 @@ install: + - ${CABAL} v2-freeze -w ${HC} ${TEST} ${BENCH} - "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'" - rm cabal.project.freeze -- - ${CABAL} v2-build -w ${HC} ${TEST} ${BENCH} --dep -j2 all | color_cabal_output -- - ${CABAL} v2-build -w ${HC} --disable-tests --disable-benchmarks --dep -j2 all | color_cabal_output -+ - travis_wait ${CABAL} v2-build -w ${HC} ${TEST} ${BENCH} --dep -j2 all | color_cabal_output -+ - travis_wait ${CABAL} v2-build -w ${HC} --disable-tests --disable-benchmarks --dep -j2 all | color_cabal_output +- - ${CABAL} v2-build -w ${HC} ${TEST} ${BENCH} --dep -j2 all +- - ${CABAL} v2-build -w ${HC} --disable-tests --disable-benchmarks --dep -j2 all ++ - travis_wait ${CABAL} v2-build -w ${HC} ${TEST} ${BENCH} --dep -j2 all ++ - travis_wait ${CABAL} v2-build -w ${HC} --disable-tests --disable-benchmarks --dep -j2 all script: - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX) # Packaging... -@@ -178,8 +189,7 @@ script: +@@ -179,8 +190,7 @@ script: - touch cabal.project - | echo 'packages: "base-compat-*/*.cabal"' >> cabal.project @@ -60,9 +69,9 @@ index 0133546..d677f11 100644 + if [ ! "x$BATTERIES" = "xNO" ] ; then (echo 'packages: "base-compat-batteries-*/*.cabal"' >> cabal.project; echo 'packages: "type-check-*/*.cabal"' >> cabal.project) ; fi - | echo "write-ghc-environment-files: always" >> cabal.project - - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^(base-compat|base-compat-batteries|type-check)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done" -@@ -195,8 +205,8 @@ script: - - if [ $HCNUMVER -ge 70002 ] && [ $HCNUMVER -lt 70201 ] || [ $HCNUMVER -ge 70202 ] && [ $HCNUMVER -lt 70401 ] || [ $HCNUMVER -ge 70402 ] ; then ${CABAL} v2-test -w ${HC} ${TEST} ${BENCH} all | color_cabal_output ; fi + - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(base-compat|base-compat-batteries|type-check)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done" +@@ -196,8 +206,8 @@ script: + - if [ $HCNUMVER -ge 70002 ] && [ $HCNUMVER -lt 70201 ] || [ $HCNUMVER -ge 70202 ] && [ $HCNUMVER -lt 70401 ] || [ $HCNUMVER -ge 70402 ] && [ $HCNUMVER -lt 70801 ] || [ $HCNUMVER -ge 70802 ] ; then ${CABAL} v2-test -w ${HC} ${TEST} ${BENCH} all ; fi # cabal check... - (cd base-compat-* && ${CABAL} -vnormal check) - - (cd base-compat-batteries-* && ${CABAL} -vnormal check) @@ -70,5 +79,5 @@ index 0133546..d677f11 100644 + - if [ ! "x$BATTERIES" = "xNO" ] ; then (cd base-compat-batteries-* && ${CABAL} -vnormal check) ; fi + - if [ ! "x$BATTERIES" = "xNO" ] ; then (cd type-check-* && ${CABAL} -vnormal check) ; fi # haddock... - - ${CABAL} v2-haddock -w ${HC} ${TEST} ${BENCH} all | color_cabal_output + - ${CABAL} v2-haddock -w ${HC} ${TEST} ${BENCH} all # Building without installed constraints for packages in global-db...