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
57 changes: 33 additions & 24 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.20250216
#
# REGENDATA ("0.19.20240514",["github","ghc-tcplugins-extra.cabal"])
# REGENDATA ("0.19.20250216",["github","ghc-tcplugins-extra.cabal"])
#
name: Haskell-CI
on:
Expand All @@ -19,7 +19,7 @@ on:
jobs:
linux:
name: Haskell-CI - Linux - ${{ matrix.compiler }}
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
timeout-minutes:
60
container:
Expand All @@ -28,24 +28,29 @@ jobs:
strategy:
matrix:
include:
- compiler: ghc-9.12.1
compilerKind: ghc
compilerVersion: 9.12.1
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.10.1
compilerKind: ghc
compilerVersion: 9.10.1
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.8.2
- compiler: ghc-9.8.4
compilerKind: ghc
compilerVersion: 9.8.2
compilerVersion: 9.8.4
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.6.5
- compiler: ghc-9.6.6
compilerKind: ghc
compilerVersion: 9.6.5
compilerVersion: 9.6.6
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.4.7
- compiler: ghc-9.4.8
compilerKind: ghc
compilerVersion: 9.4.7
compilerVersion: 9.4.8
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.2.8
Expand Down Expand Up @@ -90,16 +95,29 @@ jobs:
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 libnuma-dev
- 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.40.0/x86_64-linux-ghcup-0.1.40.0 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml;
- name: Install cabal-install
run: |
"$HOME/.ghcup/bin/ghcup" install cabal 3.14.1.1 || (cat "$HOME"/.ghcup/logs/*.* && false)
echo "CABAL=$HOME/.ghcup/bin/cabal-3.14.1.1 -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 @@ -110,21 +128,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"
if [ $((HCNUMVER > 91001)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi
if [ $((HCNUMVER > 91201)) -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:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand Down Expand Up @@ -248,8 +257,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
9 changes: 5 additions & 4 deletions .github/workflows/stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ jobs:
- "9.0.1"

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true

- uses: haskell/actions/setup@v1
- uses: haskell/actions/setup@v2
name: Setup Stack
with:
enable-stack: true
Expand All @@ -35,8 +35,9 @@ jobs:
- uses: haskell/actions/hlint-setup@v2
name: Set up HLint

- uses: actions/cache@v2
name: Cache ~/.stack
- name: Cache ~/.stack
if: always()
uses: actions/cache@v4
with:
path: ~/.stack
key: ${{ runner.os }}-${{ matrix.ghc }}-stack
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.5 *March 4th 2024*
* Add `evByFiatWithDependencies`, see https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12037 for more details.
* Added support for GHC 9.12.1

## 0.4.6 *May 22nd 2024*
* Added support for GHC-9.10.1
* Removed support for GHC 7.10
Expand Down
4 changes: 2 additions & 2 deletions defaults.dhall
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ name = "ghc-tcplugins-extra"
, version = "0.4.6"
, version = "0.5"
, synopsis = "Utilities for writing GHC type-checker plugins"
, description =
''
Expand All @@ -17,7 +17,7 @@
, license = "BSD2"
, license-file = "LICENSE"
, tested-with =
"GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.8, GHC == 9.4.7, GHC == 9.6.5, GHC == 9.8.2, GHC == 9.10.1"
"GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.8, GHC == 9.4.7, GHC == 9.6.6, GHC == 9.8.4, GHC == 9.10.1, GHC == 9.12.1"
, extra-source-files =
[ "README.md", "CHANGELOG.md", "defaults.dhall", "package.dhall" ]
, ghc-options = [ "-Wall" ]
Expand Down
23 changes: 18 additions & 5 deletions ghc-tcplugins-extra.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cabal-version: 2.0
-- see: https://github.com/sol/hpack

name: ghc-tcplugins-extra
version: 0.4.6
version: 0.5
synopsis: Utilities for writing GHC type-checker plugins
description: Utilities for writing GHC type-checker plugins, such as
creating constraints, with a stable API covering multiple
Expand All @@ -21,7 +21,7 @@ license: BSD2
license-file: LICENSE
build-type: Simple
tested-with:
GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.8, GHC == 9.4.7, GHC == 9.6.5, GHC == 9.8.2, GHC == 9.10.1
GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.8, GHC == 9.4.8, GHC == 9.6.6, GHC == 9.8.4, GHC == 9.10.1, GHC == 9.12.1
extra-source-files:
README.md
CHANGELOG.md
Expand All @@ -47,15 +47,28 @@ library
ghc-options: -Wall
build-depends:
base >=4.8 && <5
, ghc >=7.10 && <9.12
, ghc >=7.10 && <9.13
default-language: Haskell2010
if impl(ghc >= 8.0.0)
ghc-options: -Wcompat -Wincomplete-uni-patterns -Widentities -Wredundant-constraints
if impl(ghc >= 8.4.0)
ghc-options: -fhide-source-paths
if flag(deverror)
ghc-options: -Werror
if impl(ghc >= 9.10) && impl(ghc < 9.12)
if impl(ghc >= 9.11) && impl(ghc < 9.13)
other-modules:
GhcApi.Constraint
GhcApi.Predicate
GhcApi.GhcPlugins
Internal.Type
Internal.Constraint
Internal.Evidence
hs-source-dirs:
src-ghc-tree-9.4
src-ghc-9.12
build-depends:
ghc >=9.11 && <9.13
if impl(ghc >= 9.10) && impl(ghc < 9.11)
other-modules:
GhcApi.Constraint
GhcApi.Predicate
Expand All @@ -67,7 +80,7 @@ library
src-ghc-tree-9.4
src-ghc-9.10
build-depends:
ghc >=9.10 && <9.12
ghc ==9.10.*
if impl(ghc >= 9.8) && impl(ghc < 9.10)
other-modules:
GhcApi.Constraint
Expand Down
5 changes: 3 additions & 2 deletions package.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ in let ghc = { name = "ghc", mixin = [] : List Text }
// { library =
{ source-dirs = "src"
, dependencies =
[ "base >=4.8 && <5", "ghc >=7.10 && <9.12" ]
[ "base >=4.8 && <5", "ghc >=7.10 && <9.13" ]
, exposed-modules = "GHC.TcPluginM.Extra"
, other-modules = "Internal"
, when =
[ version "9.10" "9.12" [ "tree-9.4", "9.10" ] ghc mods
[ version "9.11" "9.13" [ "tree-9.4", "9.12" ] ghc mods
, version "9.10" "9.11" [ "tree-9.4", "9.10" ] ghc mods
, version "9.8" "9.10" [ "tree-9.4", "9.8" ] ghc mods
, version "9.4" "9.8" [ "tree-9.4", "9.4" ] ghc mods
, version "9.2" "9.4" [ "tree", "9.2" ] ghc mods
Expand Down
12 changes: 11 additions & 1 deletion src-ghc-8.0/Internal/Evidence.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Internal.Evidence (evByFiat) where
module Internal.Evidence (evByFiat, evByFiatWithDependencies) where

import TcEvidence (EvTerm(..))
import TyCoRep (UnivCoProvenance (..))
Expand All @@ -12,3 +12,13 @@ evByFiat :: String -- ^ Name the coercion should have
-> EvTerm
evByFiat name t1 t2 =
EvCoercion $ mkUnivCo (PluginProv name) Nominal t1 t2

-- | The 'EvTerm' equivalent for 'Unsafe.unsafeCoerce'
evByFiatWithDependencies ::
String -- ^ Name the coercion should have
-> [Coercion] -- ^ The set of all the in-scope coercion that the proof makes use of.
-> Type -- ^ The LHS of the equivalence relation (~)
-> Type -- ^ The RHS of the equivalence relation (~)
-> EvTerm
evByFiatWithDependencies name _deps t1 t2 =
EvCoercion $ mkUnivCo (PluginProv name) Nominal t1 t2
12 changes: 11 additions & 1 deletion src-ghc-8.10/Internal/Evidence.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Internal.Evidence (evByFiat) where
module Internal.Evidence (evByFiat, evByFiatWithDependencies) where

import TcEvidence (EvTerm(..))
import TyCoRep (UnivCoProvenance (..))
Expand All @@ -12,3 +12,13 @@ evByFiat :: String -- ^ Name the coercion should have
-> EvTerm
evByFiat name t1 t2 =
EvExpr $ Coercion $ mkUnivCo (PluginProv name) Nominal t1 t2

-- | The 'EvTerm' equivalent for 'Unsafe.unsafeCoerce'
evByFiatWithDependencies ::
String -- ^ Name the coercion should have
-> [Coercion] -- ^ The set of all the in-scope coercion that the proof makes use of.
-> Type -- ^ The LHS of the equivalence relation (~)
-> Type -- ^ The RHS of the equivalence relation (~)
-> EvTerm
evByFiatWithDependencies name _deps t1 t2 =
EvExpr $ Coercion $ mkUnivCo (PluginProv name) Nominal t1 t2
12 changes: 11 additions & 1 deletion src-ghc-8.2/Internal/Evidence.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Internal.Evidence (evByFiat) where
module Internal.Evidence (evByFiat, evByFiatWithDependencies) where

import TcEvidence (EvTerm(..))
import TyCoRep (UnivCoProvenance (..))
Expand All @@ -12,3 +12,13 @@ evByFiat :: String -- ^ Name the coercion should have
-> EvTerm
evByFiat name t1 t2 =
EvCoercion $ mkUnivCo (PluginProv name) Nominal t1 t2

-- | The 'EvTerm' equivalent for 'Unsafe.unsafeCoerce'
evByFiatWithDependencies ::
String -- ^ Name the coercion should have
-> [Coercion] -- ^ The set of all the in-scope coercion that the proof makes use of.
-> Type -- ^ The LHS of the equivalence relation (~)
-> Type -- ^ The RHS of the equivalence relation (~)
-> EvTerm
evByFiatWithDependencies name _deps t1 t2 =
EvCoercion $ mkUnivCo (PluginProv name) Nominal t1 t2
12 changes: 11 additions & 1 deletion src-ghc-8.4/Internal/Evidence.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Internal.Evidence (evByFiat) where
module Internal.Evidence (evByFiat, evByFiatWithDependencies) where

import TcEvidence (EvTerm(..))
import TyCoRep (UnivCoProvenance (..))
Expand All @@ -12,3 +12,13 @@ evByFiat :: String -- ^ Name the coercion should have
-> EvTerm
evByFiat name t1 t2 =
EvCoercion $ mkUnivCo (PluginProv name) Nominal t1 t2

-- | The 'EvTerm' equivalent for 'Unsafe.unsafeCoerce'
evByFiatWithDependencies ::
String -- ^ Name the coercion should have
-> [Coercion] -- ^ The set of all the in-scope coercion that the proof makes use of.
-> Type -- ^ The LHS of the equivalence relation (~)
-> Type -- ^ The RHS of the equivalence relation (~)
-> EvTerm
evByFiatWithDependencies name _deps t1 t2 =
EvCoercion $ mkUnivCo (PluginProv name) Nominal t1 t2
12 changes: 11 additions & 1 deletion src-ghc-8.6/Internal/Evidence.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Internal.Evidence (evByFiat) where
module Internal.Evidence (evByFiat, evByFiatWithDependencies) where

import TcEvidence (EvTerm(..))
import TyCoRep (UnivCoProvenance (..))
Expand All @@ -12,3 +12,13 @@ evByFiat :: String -- ^ Name the coercion should have
-> EvTerm
evByFiat name t1 t2 =
EvExpr $ Coercion $ mkUnivCo (PluginProv name) Nominal t1 t2

-- | The 'EvTerm' equivalent for 'Unsafe.unsafeCoerce'
evByFiatWithDependencies ::
String -- ^ Name the coercion should have
-> [Coercion] -- ^ The set of all the in-scope coercion that the proof makes use of.
-> Type -- ^ The LHS of the equivalence relation (~)
-> Type -- ^ The RHS of the equivalence relation (~)
-> EvTerm
evByFiatWithDependencies name _deps t1 t2 =
EvExpr $ Coercion $ mkUnivCo (PluginProv name) Nominal t1 t2
12 changes: 11 additions & 1 deletion src-ghc-8.8/Internal/Evidence.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Internal.Evidence (evByFiat) where
module Internal.Evidence (evByFiat, evByFiatWithDependencies) where

import TcEvidence (EvTerm(..))
import TyCoRep (UnivCoProvenance (..))
Expand All @@ -12,3 +12,13 @@ evByFiat :: String -- ^ Name the coercion should have
-> EvTerm
evByFiat name t1 t2 =
EvExpr $ Coercion $ mkUnivCo (PluginProv name) Nominal t1 t2

-- | The 'EvTerm' equivalent for 'Unsafe.unsafeCoerce'
evByFiatWithDependencies ::
String -- ^ Name the coercion should have
-> [Coercion] -- ^ The set of all the in-scope coercion that the proof makes use of.
-> Type -- ^ The LHS of the equivalence relation (~)
-> Type -- ^ The RHS of the equivalence relation (~)
-> EvTerm
evByFiatWithDependencies name _deps t1 t2 =
EvExpr $ Coercion $ mkUnivCo (PluginProv name) Nominal t1 t2
14 changes: 12 additions & 2 deletions src-ghc-9.0/Internal/Evidence.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Internal.Evidence (evByFiat) where
module Internal.Evidence (evByFiat, evByFiatWithDependencies) where

import GHC.Tc.Types.Evidence (EvTerm(..))
import GHC.Core.TyCo.Rep (UnivCoProvenance (..))
Expand All @@ -11,4 +11,14 @@ evByFiat :: String -- ^ Name the coercion should have
-> Type -- ^ The RHS of the equivalence relation (~)
-> EvTerm
evByFiat name t1 t2 =
EvExpr $ Coercion $ mkUnivCo (PluginProv name) Nominal t1 t2
EvExpr $ Coercion $ mkUnivCo (PluginProv name) Nominal t1 t2

-- | The 'EvTerm' equivalent for 'Unsafe.unsafeCoerce'
evByFiatWithDependencies ::
String -- ^ Name the coercion should have
-> [Coercion] -- ^ The set of all the in-scope coercion that the proof makes use of.
-> Type -- ^ The LHS of the equivalence relation (~)
-> Type -- ^ The RHS of the equivalence relation (~)
-> EvTerm
evByFiatWithDependencies name _deps t1 t2 =
EvExpr $ Coercion $ mkUnivCo (PluginProv name) Nominal t1 t2
Loading
Loading