Skip to content

Commit

Permalink
Merge pull request #122 from haskellari/ghc-9.6
Browse files Browse the repository at this point in the history
Add GHC-9.6 job
  • Loading branch information
phadej authored Mar 15, 2023
2 parents 6b22c2e + f5dae3d commit 538ae98
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 43 deletions.
39 changes: 28 additions & 11 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.15.20221225
# version: 0.15.20230313
#
# REGENDATA ("0.15.20221225",["github","--config=cabal.haskell-ci","lattices.cabal"])
# REGENDATA ("0.15.20230313",["github","--config=cabal.haskell-ci","lattices.cabal"])
#
name: Haskell-CI
on:
Expand All @@ -32,6 +32,11 @@ jobs:
strategy:
matrix:
include:
- compiler: ghc-9.6.1
compilerKind: ghc
compilerVersion: 9.6.1
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.4.4
compilerKind: ghc
compilerVersion: 9.4.4
Expand Down Expand Up @@ -103,15 +108,15 @@ jobs:
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" || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.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.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 || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
fi
env:
HCKIND: ${{ matrix.compilerKind }}
Expand All @@ -129,13 +134,13 @@ jobs:
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV"
echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
else
HC=$HCDIR/bin/$HCKIND
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
fi
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
Expand Down Expand Up @@ -185,7 +190,7 @@ jobs:
run: |
$CABAL v2-update -v
- name: cache (tools)
uses: actions/cache@v2
uses: actions/cache/restore@v3
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-4095ff06
path: ~/.haskell-ci-tools
Expand All @@ -211,8 +216,14 @@ jobs:
run: |
if [ $((HCNUMVER >= 80000 && HCNUMVER < 90000)) -ne 0 ] ; then $CABAL --store-dir=$HOME/.haskell-ci-tools/store v2-install $ARG_COMPILER --ignore-project -j2 doctest --constraint='doctest ^>=0.20' ; fi
if [ $((HCNUMVER >= 80000 && HCNUMVER < 90000)) -ne 0 ] ; then doctest --version ; fi
- name: save cache (tools)
uses: actions/cache/save@v3
if: always()
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-4095ff06
path: ~/.haskell-ci-tools
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: source
- name: initial cabal.project for sdist
Expand Down Expand Up @@ -247,8 +258,8 @@ jobs:
run: |
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
cabal-plan
- name: cache
uses: actions/cache@v2
- name: restore cache
uses: actions/cache/restore@v3
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
Expand Down Expand Up @@ -280,7 +291,7 @@ jobs:
${CABAL} -vnormal check
- name: haddock
run: |
$CABAL v2-haddock --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
$CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
- name: unconstrained build
run: |
rm -f cabal.project.local
Expand All @@ -292,3 +303,9 @@ jobs:
run: |
if [ $((HCNUMVER >= 80800)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='transformers ^>=0.6' --dependencies-only -j2 all ; fi
if [ $((HCNUMVER >= 80800)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='transformers ^>=0.6' all ; fi
- name: save cache
uses: actions/cache/save@v3
if: always()
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 2.2 (2022-03-15)

- Drop `semigroupoids` dependency in favour of `foldable1-classes-compat`.
Be careful with which `Foldable1` class you end up using.

# 2.1 (2022-12-27)

- Fix `comprable` for `PartialOrd (a,b)` instance
Expand Down
13 changes: 8 additions & 5 deletions lattices.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 1.18
name: lattices
version: 2.1
version: 2.2
category: Math
license: BSD3
license-file: LICENSE
Expand Down Expand Up @@ -34,6 +34,7 @@ tested-with:
|| ==9.0.2
|| ==9.2.5
|| ==9.4.4
|| ==9.6.1

synopsis:
Fine-grained library for constructing and manipulating lattices
Expand Down Expand Up @@ -82,25 +83,27 @@ library
Algebra.PartialOrd.Instances

build-depends:
base >=4.6 && <4.18
, base-compat >=0.10.5 && <0.13
base >=4.6 && <4.19
, base-compat >=0.13 && <0.14
, containers >=0.5.0.0 && <0.7
, deepseq >=1.3.0.0 && <1.5
, hashable >=1.2.7.0 && <1.5
, integer-logarithms >=1.0.3 && <1.1
, QuickCheck >=2.12.6.1 && <2.15
, semigroupoids >=5.3.2 && <5.4
, tagged >=0.8.6 && <0.9
, transformers >=0.3.0.0 && <0.7
, universe-base >=1.1 && <1.2
, universe-reverse-instances >=1.1 && <1.2
, unordered-containers >=0.2.8.0 && <0.3

if !impl(ghc >=9.6)
build-depends: foldable1-classes-compat >=0.1 && <0.2

if !impl(ghc >=9.2)
if impl(ghc >=9.0)
build-depends: ghc-prim
else
build-depends: OneTuple >=0.3 && <0.4
build-depends: OneTuple >=0.4 && <0.5

if !impl(ghc >=8.0)
build-depends: semigroups >=0.18.5 && <0.21
Expand Down
18 changes: 11 additions & 7 deletions src/Algebra/Heyting.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,16 @@ import Data.Universe.Class (Finite (..))
import qualified Data.HashSet as HS
import qualified Data.Set as Set

#if MIN_VERSION_base(4,16,0)
import Data.Tuple (Solo (..))
#if MIN_VERSION_base(4,18,0)
import Data.Tuple (Solo (MkSolo))
#elif MIN_VERSION_base(4,16,0)
import Data.Tuple (Solo (Solo))
#define MkSolo Solo
#elif MIN_VERSION_base(4,15,0)
import GHC.Tuple (Solo (..))
import GHC.Tuple (Solo (Solo))
#define MkSolo Solo
#else
import Data.Tuple.Solo (Solo (..))
import Data.Tuple.Solo (Solo (MkSolo))
#endif

-- | A Heyting algebra is a bounded lattice equipped with a
Expand Down Expand Up @@ -135,9 +139,9 @@ instance Heyting a => Heyting (Const a b) where

-- | @since 2.0.3
instance Heyting a => Heyting (Solo a) where
Solo a ==> Solo b = Solo (a ==> b)
neg (Solo a) = Solo (neg a)
Solo a <=> Solo b = Solo (a <=> b)
MkSolo a ==> MkSolo b = MkSolo (a ==> b)
neg (MkSolo a) = MkSolo (neg a)
MkSolo a <=> MkSolo b = MkSolo (a <=> b)

-------------------------------------------------------------------------------
-- Sets
Expand Down
44 changes: 24 additions & 20 deletions src/Algebra/Lattice.hs
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,18 @@ import Prelude.Compat

import qualified Algebra.PartialOrd as PO

import Control.Applicative (Const (..))
import Control.Monad.Zip (MonadZip (..))
import Data.Data (Data, Typeable)
import Data.Functor.Identity (Identity (..))
import Data.Hashable (Hashable (..))
import Data.Proxy (Proxy (..))
import Data.Semigroup (All (..), Any (..), Endo (..), Semigroup (..))
import Data.Semigroup.Foldable (Foldable1 (..))
import Data.Tagged (Tagged (..))
import Data.Universe.Class (Finite (..), Universe (..))
import Data.Void (Void)
import GHC.Generics (Generic)
import Control.Applicative (Const (..))
import Control.Monad.Zip (MonadZip (..))
import Data.Data (Data, Typeable)
import Data.Foldable1 (Foldable1 (..))
import Data.Functor.Identity (Identity (..))
import Data.Hashable (Hashable (..))
import Data.Proxy (Proxy (..))
import Data.Semigroup (All (..), Any (..), Endo (..), Semigroup (..))
import Data.Tagged (Tagged (..))
import Data.Universe.Class (Finite (..), Universe (..))
import Data.Void (Void)
import GHC.Generics (Generic)

import qualified Data.HashMap.Lazy as HM
import qualified Data.HashSet as HS
Expand All @@ -66,12 +66,16 @@ import qualified Data.Map as Map
import qualified Data.Set as Set
import qualified Test.QuickCheck as QC

#if MIN_VERSION_base(4,16,0)
import Data.Tuple (Solo (..))
#if MIN_VERSION_base(4,18,0)
import Data.Tuple (Solo (MkSolo))
#elif MIN_VERSION_base(4,16,0)
import Data.Tuple (Solo (Solo))
#define MkSolo Solo
#elif MIN_VERSION_base(4,15,0)
import GHC.Tuple (Solo (..))
import GHC.Tuple (Solo (Solo))
#define MkSolo Solo
#else
import Data.Tuple.Solo (Solo (..))
import Data.Tuple.Solo (Solo (MkSolo))
#endif

infixr 6 /\ -- This comment needed because of CPP
Expand Down Expand Up @@ -529,16 +533,16 @@ instance BoundedMeetSemiLattice QC.Property where top = QC.property True

-- | @since 2.0.3
instance Lattice a => Lattice (Solo a) where
Solo a \/ Solo b = Solo (a \/ b)
Solo a /\ Solo b = Solo (a /\ b)
MkSolo a \/ MkSolo b = MkSolo (a \/ b)
MkSolo a /\ MkSolo b = MkSolo (a /\ b)

-- | @since 2.0.3
instance BoundedMeetSemiLattice a => BoundedMeetSemiLattice (Solo a) where
top = Solo top
top = MkSolo top

-- | @since 2.0.3
instance BoundedJoinSemiLattice a => BoundedJoinSemiLattice (Solo a) where
bottom = Solo bottom
bottom = MkSolo bottom

-------------------------------------------------------------------------------
-- Theorems
Expand Down

0 comments on commit 538ae98

Please sign in to comment.