Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for GHC 9.10 and drop 9.4 #425

Merged
merged 4 commits into from
Dec 26, 2024
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
47 changes: 26 additions & 21 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.19.20240514
# version: 0.19.20241202
#
# REGENDATA ("0.19.20240514",["github","disco.cabal"])
# REGENDATA ("0.19.20241202",["github","disco.cabal"])
#
name: Haskell-CI
on:
Expand All @@ -28,32 +28,46 @@ jobs:
strategy:
matrix:
include:
- compiler: ghc-9.8.2
- compiler: ghc-9.10.1
compilerKind: ghc
compilerVersion: 9.8.2
compilerVersion: 9.10.1
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.6.5
- compiler: ghc-9.8.4
compilerKind: ghc
compilerVersion: 9.6.5
compilerVersion: 9.8.4
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.4.8
- compiler: ghc-9.6.6
compilerKind: ghc
compilerVersion: 9.4.8
compilerVersion: 9.6.6
setup-method: ghcup
allow-failure: false
fail-fast: false
steps:
- name: apt
- name: apt-get install
run: |
apt-get update
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
- name: Install GHCup
run: |
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
- name: Install cabal-install
run: |
"$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
- name: Install GHC (GHCup)
if: matrix.setup-method == 'ghcup'
run: |
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand All @@ -64,21 +78,12 @@ jobs:
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
HCDIR=/opt/$HCKIND/$HCVER
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand Down Expand Up @@ -194,8 +199,8 @@ jobs:
rm -f cabal.project.local
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
- name: save cache
uses: actions/cache/save@v4
if: always()
uses: actions/cache/save@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
12 changes: 6 additions & 6 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ queue_rules:
- -files~=\.cabal$
- -files=stack.yaml
- and:
- check-success=Haskell-CI - Linux - ghc-9.8.2
- check-success=Haskell-CI - Linux - ghc-9.6.5
- check-success=Haskell-CI - Linux - ghc-9.4.8
- check-success=Haskell-CI - Linux - ghc-9.10.1
- check-success=Haskell-CI - Linux - ghc-9.8.4
- check-success=Haskell-CI - Linux - ghc-9.6.6
- label=merge me
- '#approved-reviews-by>=1'
- '#changes-requested-reviews-by=0'
Expand All @@ -22,9 +22,9 @@ queue_rules:
- -files~=\.cabal$
- -files=stack.yaml
- and:
- check-success=Haskell-CI - Linux - ghc-9.8.2
- check-success=Haskell-CI - Linux - ghc-9.6.5
- check-success=Haskell-CI - Linux - ghc-9.4.8
- check-success=Haskell-CI - Linux - ghc-9.10.1
- check-success=Haskell-CI - Linux - ghc-9.8.4
- check-success=Haskell-CI - Linux - ghc-9.6.6

commit_message_template: |
{{ title }} (#{{ number }})
Expand Down
40 changes: 0 additions & 40 deletions .travis.yml

This file was deleted.

12 changes: 6 additions & 6 deletions disco.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ maintainer: byorgey@gmail.com
copyright: Disco team 2016-2022 (see LICENSE)
category: Language

tested-with: GHC ==9.4.8 || ==9.6.5 || ==9.8.2
tested-with: GHC ==9.6.6 || ==9.8.4 || ==9.10.1

data-dir: lib

Expand Down Expand Up @@ -469,7 +469,7 @@ library

autogen-modules: Paths_disco

build-depends: base >=4.8 && <4.20,
build-depends: base >=4.8 && <4.21,
filepath,
directory,
mtl >=2.2 && <2.4,
Expand Down Expand Up @@ -537,11 +537,11 @@ test-suite disco-tests
hs-source-dirs: test
ghc-options: -threaded
build-tool-depends: disco:disco
build-depends: base >= 4.7 && < 4.20,
build-depends: base >= 4.7 && < 4.21,
tasty >= 0.10 && < 1.6,
tasty-golden >= 2.3 && < 2.4,
directory >= 1.2 && < 1.4,
filepath >= 1.4 && < 1.5,
filepath >= 1.4 && < 1.6,
process >= 1.4 && < 1.7,
bytestring >= 0.9 && < 0.13,
disco
Expand All @@ -554,8 +554,8 @@ test-suite disco-examples
hs-source-dirs: example
ghc-options: -threaded
build-tool-depends: disco:disco
build-depends: base >= 4.7 && < 4.20,
build-depends: base >= 4.7 && < 4.21,
directory >= 1.2 && < 1.4,
filepath >= 1.4 && < 1.5,
filepath >= 1.4 && < 1.6,
process >= 1.4 && < 1.7
default-language: Haskell2010
1 change: 1 addition & 0 deletions src/Disco/Desugar.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{-# OPTIONS_GHC -fno-warn-unrecognised-pragmas #-}
{-# OPTIONS_GHC -fno-warn-x-data-list-nonempty-unzip #-}

{-# HLINT ignore "Functor law" #-}

Expand Down
22 changes: 11 additions & 11 deletions src/Disco/Typecheck/Solve.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,15 @@
-- checking/inference.
module Disco.Typecheck.Solve where

import Unbound.Generics.LocallyNameless (
Alpha,
Name,
Subst,
fv,
name2Integer,
string2Name,
substs,
)

import Control.Arrow ((&&&), (***))
import Control.Lens hiding (use, (%=), (.=))
import Control.Monad (forM, join, unless, zipWithM)
import Data.Bifunctor (first, second)
import Data.Coerce
import Data.Either (partitionEithers)
import Data.Foldable (Foldable (..))
import Data.List (
find,
foldl',
intersect,
partition,
)
Expand Down Expand Up @@ -69,6 +59,16 @@ import Polysemy
import Polysemy.Error
import Polysemy.Input
import Polysemy.Output
import Unbound.Generics.LocallyNameless (
Alpha,
Name,
Subst,
fv,
name2Integer,
string2Name,
substs,
)
import Prelude hiding (Foldable (..))

--------------------------------------------------
-- Solver errors
Expand Down
12 changes: 4 additions & 8 deletions src/Disco/Types/Rules.hs
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
-----------------------------------------------------------------------------

-----------------------------------------------------------------------------

-- SPDX-License-Identifier: BSD-3-Clause

-- |
-- Module : Disco.Types.Rules
-- Copyright : disco team and contributors
-- Maintainer : byorgey@gmail.com
--
-- SPDX-License-Identifier: BSD-3-Clause
--
-- "Disco.Types.Rules" defines some generic rules about arity,
-- subtyping, and sorts for disco base types.
module Disco.Types.Rules (
Expand Down Expand Up @@ -44,13 +40,13 @@ module Disco.Types.Rules (
where

import Control.Monad ((>=>))
import Data.List (foldl')
import Data.Foldable (Foldable (..))
import Data.Map (Map)
import qualified Data.Map as M
import qualified Data.Set as S

import Disco.Types
import Disco.Types.Qualifiers
import Prelude hiding (Foldable (..))

------------------------------------------------------------
-- Arity
Expand Down
17 changes: 6 additions & 11 deletions src/Disco/Value.hs
Original file line number Diff line number Diff line change
Expand Up @@ -76,38 +76,33 @@ module Disco.Value (
prettyValue,
) where

import Prelude hiding ((<>))
import qualified Prelude as P

import Algebra.Graph (Graph, foldg)
import Control.Monad (forM)
import Data.Bifunctor (first)
import Data.Char (chr, ord)
import Data.Foldable (Foldable (..))
import Data.IntMap (IntMap)
import qualified Data.IntMap as IM
import Data.List (foldl')
import Data.Map (Map)
import qualified Data.Map as M
import Data.Ratio

import Algebra.Graph (Graph, foldg)

import Disco.AST.Core
import Disco.AST.Generic (Side (..))
import Disco.Context as Ctx
import Disco.Effects.LFresh
import Disco.Error
import Disco.Names
import Disco.Pretty
import Disco.Syntax.Operators (BOp (Add, Mul))
import Disco.Types

import Disco.Effects.LFresh
import Polysemy
import Polysemy.Input
import Polysemy.Reader
import Polysemy.State
import Unbound.Generics.LocallyNameless (Name)

import System.Random (StdGen)
import Unbound.Generics.LocallyNameless (Name)
import Prelude hiding (Foldable (..), (<>))
import qualified Prelude as P

------------------------------------------------------------
-- Value type
Expand Down
Loading
Loading