Skip to content

Commit

Permalink
Updates for GHC 8.8
Browse files Browse the repository at this point in the history
checks off the `base-4.13.0.0` box in #24.
  • Loading branch information
RyanGlScott committed May 11, 2019
1 parent bbd7abc commit 1b25b39
Show file tree
Hide file tree
Showing 18 changed files with 120 additions and 56 deletions.
19 changes: 18 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand All @@ -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)
Expand Down Expand Up @@ -156,6 +161,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
Expand Down
6 changes: 6 additions & 0 deletions base-compat-batteries/CHANGES.markdown
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Changes in 0.11.0 [????.??.??]
- Reexport `MonadFail(fail)` from `Prelude.Compat` and `Control.Monad.Compat`.
- 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)
Expand Down
5 changes: 3 additions & 2 deletions base-compat-batteries/base-compat-batteries.cabal
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 4 additions & 2 deletions base-compat-batteries/src/Control/Monad/Compat.hs
Original file line number Diff line number Diff line change
@@ -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)
5 changes: 5 additions & 0 deletions base-compat-batteries/src/Prelude/Compat.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 12 additions & 0 deletions base-compat/CHANGES.markdown
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## Changes in 0.11.0 [????.??.??]
- Sync with `base-4.13`/GHC 8.8
- Backport `MonadFail(fail)` to `Prelude.Compat` and `Control.Monad.Compat`.

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`.

Expand Down
2 changes: 2 additions & 0 deletions base-compat/README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
3 changes: 2 additions & 1 deletion base-compat/base-compat.cabal
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions base-compat/src/Control/Monad/Compat.hs
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
17 changes: 14 additions & 3 deletions base-compat/src/Prelude/Compat.hs
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ module Prelude.Compat (
, Functor
, Integral
, Monad
#if MIN_VERSION_base(4,9,0)
, MonadFail
#endif
, Monoid
, Num (fromInteger)
, Ord
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion check/lib/Util.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
]

Expand Down
5 changes: 3 additions & 2 deletions check/type-check.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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 <sol@typeful.net>,
João Cristóvão <jmacristovao@gmail.com>,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions check/types/Control.Monad.Compat.types
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 ()
18 changes: 9 additions & 9 deletions check/types/Data.Foldable.Compat.types
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 ()
Expand Down
Loading

0 comments on commit 1b25b39

Please sign in to comment.