Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: haskellari/some
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 18e1b460ceca8b721650ad735b290f70111587bf
Choose a base ref
..
head repository: haskellari/some
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0b40a5b0e2fc9a886912600942c6106babc6743c
Choose a head ref
Showing with 195 additions and 23 deletions.
  1. +35 −11 .github/workflows/haskell-ci.yml
  2. +7 −0 ChangeLog.md
  3. +1 −0 cabal.haskell-ci
  4. +4 −5 some.cabal
  5. +1 −0 src/Data/GADT/Compare.hs
  6. +28 −0 src/Data/GADT/DeepSeq.hs
  7. +117 −7 src/Data/GADT/Internal.hs
  8. +1 −0 src/Data/Some/GADT.hs
  9. +1 −0 src/Data/Some/Newtype.hs
46 changes: 35 additions & 11 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
@@ -8,9 +8,9 @@
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.13.20211030
# version: 0.15.20220808
#
# REGENDATA ("0.13.20211030",["github","cabal.project"])
# REGENDATA ("0.15.20220808",["github","cabal.project"])
#
name: Haskell-CI
on:
@@ -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.1
compilerKind: ghc
compilerVersion: 9.2.1
compilerVersion: 9.4.1
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.2.4
compilerKind: ghc
compilerVersion: 9.2.4
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.0.1
@@ -63,18 +70,18 @@ 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.18.0/x86_64-linux-ghcup-0.1.18.0 > "$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
"$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.18.0/x86_64-linux-ghcup-0.1.18.0 > "$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 }}
@@ -134,6 +141,10 @@ jobs:
repository hackage.haskell.org
url: http://hackage.haskell.org/
EOF
cat >> $CABAL_CONFIG <<EOF
program-default-options
ghc-options: $GHCJOBS +RTS -M3G -RTS
EOF
cat $CABAL_CONFIG
- name: versions
run: |
@@ -152,6 +163,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:
@@ -207,13 +227,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
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.
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
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.1.0
x-revision: 2
stability: provisional
cabal-version: >=1.10
build-type: Simple
author:
@@ -30,7 +28,8 @@ tested-with:
|| ==8.8.4
|| ==8.10.4
|| ==9.0.1
|| ==9.2.1
|| ==9.2.4
|| ==9.4.1

extra-source-files: ChangeLog.md

@@ -65,10 +64,10 @@ library

other-modules: Data.GADT.Internal
build-depends:
base >=4.12 && <4.17
base >=4.18 && <4.19
, 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)
1 change: 1 addition & 0 deletions src/Data/GADT/Compare.hs
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
module Data.GADT.Compare (
-- * Equality
GEq (..),
defaultGeq,
defaultEq,
defaultNeq,
-- * Total order comparison
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 #-}
{-# LANGUAGE PolyKinds #-}
#if __GLASGOW_HASKELL__ >= 810
{-# LANGUAGE StandaloneKindSignatures #-}
@@ -13,6 +14,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
@@ -35,10 +48,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
Loading