Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 52 additions & 12 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.13.20211030
# version: 0.15.20220609
#
# REGENDATA ("0.13.20211030",["github","cabal.project"])
# REGENDATA ("0.15.20220609",["github","cabal.project"])
#
name: Haskell-CI
on:
Expand All @@ -23,16 +23,23 @@ on:
jobs:
linux:
name: Haskell-CI - Linux - ${{ matrix.compiler }}
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
timeout-minutes:
60
container:
image: buildpack-deps:bionic
continue-on-error: ${{ matrix.allow-failure }}
strategy:
matrix:
include:
- compiler: ghc-9.2.1
- compiler: ghc-9.4.0.20220523
compilerKind: ghc
compilerVersion: 9.2.1
compilerVersion: 9.4.0.20220523
setup-method: ghcup
allow-failure: true
- compiler: ghc-9.2.3
compilerKind: ghc
compilerVersion: 9.2.3
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.0.1
Expand Down Expand Up @@ -108,18 +115,19 @@ jobs:
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
if [ "${{ matrix.setup-method }}" = ghcup ]; then
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.17.3/x86_64-linux-ghcup-0.1.17.3 > "$HOME/.ghcup/bin/ghcup"
curl -sL https://downloads.haskell.org/ghcup/0.1.17.8/x86_64-linux-ghcup-0.1.17.8 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER"
"$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0
if $HEADHACKAGE; then "$HOME/.ghcup/bin/ghcup" config add-release-channel https://github.com/raw/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml; fi
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
else
apt-add-repository -y 'ppa:hvr/ghc'
apt-get update
apt-get install -y "$HCNAME"
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.17.3/x86_64-linux-ghcup-0.1.17.3 > "$HOME/.ghcup/bin/ghcup"
curl -sL https://downloads.haskell.org/ghcup/0.1.17.8/x86_64-linux-ghcup-0.1.17.8 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0
"$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
fi
env:
HCKIND: ${{ matrix.compilerKind }}
Expand Down Expand Up @@ -150,7 +158,7 @@ jobs:
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
env:
Expand Down Expand Up @@ -179,6 +187,22 @@ jobs:
repository hackage.haskell.org
url: http://hackage.haskell.org/
EOF
if $HEADHACKAGE; then
cat >> $CABAL_CONFIG <<EOF
repository head.hackage.ghc.haskell.org
url: https://ghc.gitlab.haskell.org/head.hackage/
secure: True
root-keys: 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
key-threshold: 3
active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override
EOF
fi
cat >> $CABAL_CONFIG <<EOF
program-default-options
ghc-options: $GHCJOBS +RTS -M3G -RTS
EOF
cat $CABAL_CONFIG
- name: versions
run: |
Expand All @@ -197,6 +221,15 @@ jobs:
rm -f cabal-plan.xz
chmod a+x $HOME/.cabal/bin/cabal-plan
cabal-plan --version
- name: install cabal-docspec
run: |
mkdir -p $HOME/.cabal/bin
curl -sL https://github.com/phadej/cabal-extras/releases/download/cabal-docspec-0.0.0.20211114/cabal-docspec-0.0.0.20211114.xz > cabal-docspec.xz
echo 'e224700d9e8c9ec7ec6bc3f542ba433cd9925a5d356676c62a9bd1f2c8be8f8a cabal-docspec.xz' | sha256sum -c -
xz -d < cabal-docspec.xz > $HOME/.cabal/bin/cabal-docspec
rm -f cabal-docspec.xz
chmod a+x $HOME/.cabal/bin/cabal-docspec
cabal-docspec --version
- name: checkout
uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -226,6 +259,9 @@ jobs:
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
cat >> cabal.project <<EOF
EOF
if $HEADHACKAGE; then
echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1,/g')" >> cabal.project
fi
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(some)$/; }' >> cabal.project.local
cat cabal.project
cat cabal.project.local
Expand All @@ -252,13 +288,17 @@ jobs:
- name: tests
run: |
$CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct
- name: docspec
run: |
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then cabal-docspec $ARG_COMPILER ; fi
- name: cabal check
run: |
cd ${PKGDIR_some} || false
${CABAL} -vnormal check
- name: haddock
run: |
$CABAL v2-haddock $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
$CABAL v2-haddock --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
- name: unconstrained build
run: |
rm -f cabal.project.local
Expand Down
7 changes: 7 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 1.0.4

- Add instances for `(:~~:)`
- Add instances for `:+:` and `:*:`
- Add `defaultGeq :: GCompare f => f a -> f b -> Maybe (a :~: b)`
- Add `defaultGshowsPrec :: Show (t a) => Int -> t a -> ShowS`

# 1.0.3

- Make `GNFData` PolyKinded.
Expand Down
1 change: 1 addition & 0 deletions cabal.haskell-ci
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
branches : master
docspec: >=8.2

constraint-set safe
constraints: some -newtype-unsafe
Expand Down
9 changes: 4 additions & 5 deletions some.cabal
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
name: some
version: 1.0.3
x-revision: 2
stability: provisional
version: 1.0.4
cabal-version: >=1.10
build-type: Simple
author:
Expand Down Expand Up @@ -39,7 +37,8 @@ tested-with:
|| ==8.8.4
|| ==8.10.4
|| ==9.0.1
|| ==9.2.1
|| ==9.2.3
|| ==9.4.1

extra-source-files: ChangeLog.md

Expand Down Expand Up @@ -77,7 +76,7 @@ library
base >=4.3 && <4.17
, deepseq >=1.3.0.0 && <1.5

if !impl(ghc >=7.8)
if !impl(ghc >=8.2)
build-depends: type-equality >=1 && <1.1

if !impl(ghc >=8.0)
Expand Down
1 change: 1 addition & 0 deletions src/Data/GADT/Compare.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
module Data.GADT.Compare (
-- * Equality
GEq (..),
defaultGeq,
defaultEq,
defaultNeq,
-- * Total order comparison
Expand Down
28 changes: 28 additions & 0 deletions src/Data/GADT/DeepSeq.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeOperators #-}
#if __GLASGOW_HASKELL__ >= 706
{-# LANGUAGE PolyKinds #-}
#endif
Expand All @@ -19,6 +20,18 @@ import Data.Functor.Product (Product (..))
import Data.Functor.Sum (Sum (..))
import Data.Type.Equality ((:~:) (..))

#if MIN_VERSION_base(4,6,0)
import GHC.Generics ((:+:) (..), (:*:) (..))
#endif

#if MIN_VERSION_base(4,9,0)
#if MIN_VERSION_base(4,10,0)
import Data.Type.Equality ((:~~:) (..))
#else
import Data.Type.Equality.Hetero ((:~~:) (..))
#endif
#endif

#if MIN_VERSION_base(4,10,0)
import qualified Type.Reflection as TR
#endif
Expand All @@ -41,10 +54,25 @@ instance (GNFData a, GNFData b) => GNFData (Sum a b) where
grnf (InL x) = grnf x
grnf (InR y) = grnf y

#if MIN_VERSION_base(4,6,0)
instance (GNFData a, GNFData b) => GNFData (a :*: b) where
grnf (a :*: b) = grnf a `seq` grnf b

instance (GNFData a, GNFData b) => GNFData (a :+: b) where
grnf (L1 x) = grnf x
grnf (R1 y) = grnf y
#endif

-- | @since 1.0.3
instance GNFData ((:~:) a) where
grnf Refl = ()

#if MIN_VERSION_base(4,9,0)
-- | @since 1.0.4
instance GNFData ((:~~:) a) where
grnf HRefl = ()
#endif

#if MIN_VERSION_base(4,10,0)
-- | @since 1.0.3
instance GNFData TR.TypeRep where
Expand Down
Loading