From ce84c204c4ddbbebcb404e65957b1a1538c6ee52 Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Thu, 2 Oct 2025 10:34:05 +1000 Subject: [PATCH 1/2] cabal-project: Update index-states --- cabal.project | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/cabal.project b/cabal.project index 348d9c61c2b..1fc9823c02b 100644 --- a/cabal.project +++ b/cabal.project @@ -14,9 +14,9 @@ repository cardano-haskell-packages -- update either of these. index-state: -- Bump both the following dates if you need newer packages from Hackage - , hackage.haskell.org 2025-09-21T21:31:06Z + , hackage.haskell.org 2025-10-01T19:08:20Z -- Bump this if you need newer packages from CHaP - , cardano-haskell-packages 2025-09-18T12:21:32Z + , cardano-haskell-packages 2025-10-01T14:54:47Z packages: cardano-constitution plutus-benchmark @@ -75,15 +75,10 @@ source-repository-package tag: e814b9171398cbdfecdc6823067156a7e9fc76a3 allow-newer: - -- https://github.com/tweag/HaskellR/pull/420 - , inline-r:singletons-th - , inline-r:aeson - , inline-r:text - , inline-r:template-haskell - , inline-r:deepseq - , inline-r:bytestring - , inline-r:containers - , inline-r:primitive + -- https://github.com/phadej/vec/issues/121 + ral:QuickCheck, + fin:QuickCheck, + bin:QuickCheck, -- https://github.com/IntersectMBO/plutus/pull/7236 constraints: setup.optparse-applicative >=0.19.0.0 From 7e77aee4deeb079465d80bfa9dcb67462204c90a Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Thu, 2 Oct 2025 11:17:49 +1000 Subject: [PATCH 2/2] Preliminary ghc9.14 support Currently using ghc-9.14.0.20250908. --- cabal.project | 194 ++++++++++++++++++ .../src/PlutusCore/Core/Instance/Eq.hs | 12 +- .../plutus-core/src/PlutusCore/Error.hs | 7 + .../src/PlutusIR/Core/Instance/Flat.hs | 8 + .../QuickCheck/SubstitutionTests.hs | 9 + .../Generators/QuickCheck/Common.hs | 7 + .../src/UntypedPlutusCore/Core/Instance/Eq.hs | 9 +- .../src/PlutusLedgerApi/V1/Interval.hs | 7 + plutus-tx/src/PlutusTx/Blueprint/Schema.hs | 7 + plutus-tx/src/PlutusTx/Builtins/HasOpaque.hs | 6 + plutus-tx/src/PlutusTx/These.hs | 7 + plutus-tx/test/Show/Spec.hs | 7 + 12 files changed, 276 insertions(+), 4 deletions(-) diff --git a/cabal.project b/cabal.project index 1fc9823c02b..3e7bc96cebf 100644 --- a/cabal.project +++ b/cabal.project @@ -83,3 +83,197 @@ allow-newer: -- https://github.com/IntersectMBO/plutus/pull/7236 constraints: setup.optparse-applicative >=0.19.0.0 allow-newer: turtle:optparse-applicative + +if impl (ghc >= 9.14) + -- https://github.com/snowleopard/alga/issues/322 + source-repository-package + type: git + location: https://github.com/snowleopard/alga/ + tag: d4e43fb42db05413459fb2df493361d5a666588a + +-- cabal-allow-newer +if impl (ghc >= 9.14) + allow-newer: + , Cabal:Cabal-syntax + , Cabal:containers + , OneTuple:base + , QuickCheck:splitmix + , aeson:OneTuple + , aeson:containers + , aeson:data-fix + , aeson:ghc-prim + , aeson:indexed-traversable + , aeson:scientific + , aeson:semialign + , aeson:template-haskell + , aeson:text-iso8601 + , aeson:these + , aeson:time + , aeson:time-compat + , aeson:witherable + , assoc:base + , async:base + , base:ghc-prim + , bifunctors:template-haskell + , bin:base + , binary:containers + , binary-orphans:base + , boring:base + , brick:base + , canonical-json:containers + , cardano-crypto-class:io-classes + , cardano-prelude:base + , cborg:base + , cborg:containers + , cborg:ghc-prim + , concurrent-output:process + , config-ini:containers + , config-ini:text + , constraints-extras:base + , constraints-extras:template-haskell + , containers:base + , containers:template-haskell + , criterion:aeson + , data-default:containers + , data-default-class:data-default + , data-fix:base + , dec:base + , deepseq:base + , deepseq:ghc-prim + , dependent-map:containers + , deriving-compat:containers + , deriving-compat:template-haskell + , dictionary-sharing:containers + , directory:base + , directory:time + , dom-lt:containers + , fin:base + , fin:universe-base + , foldl:containers + , free:containers + , free:template-haskell + , generically:base + , ghc-heap:containers + , hashable:base + , hashable:containers + , hashable:ghc-bignum + , hedgehog:containers + , hedgehog:template-haskell + , hedgehog:time + , hedgehog-fn:hedgehog + , hsc2hs:base + , indexed-traversable:base + , indexed-traversable:containers + , indexed-traversable-instances:base + , integer-conversion:base + , integer-logarithms:base + , integer-logarithms:ghc-bignum + , io-classes:base + , io-classes:time + , lens:containers + , lens:free + , lens:template-haskell + , list-t:foldl + , megaparsec:base + , megaparsec:containers + , megaparsec:transformers + , microlens-mtl:microlens + , microlens-th:containers + , microlens-th:template-haskell + , microstache:aeson + , microstache:base + , microstache:containers + , microstache:unordered-containers + , microstache:vector + , monoidal-containers:base + , monoidal-containers:containers + , network-uri:th-compat + , nonempty-vector:base + , nothunks:containers + , nothunks:time + , nothunks:wherefrom-compat + , ordered-containers:containers + , os-string:template-haskell + , parallel:base + , parsec:text + , plutus-core:dependent-map + , plutus-core:microlens-th + , plutus-core:vty + , primitive:base + , process:base + , process:unix + , quickcheck-instances:base + , quickcheck-instances:containers + , ral:base + , ral:boring + , recursion-schemes:containers + , recursion-schemes:template-haskell + , scientific:base + , scientific:containers + , scientific:integer-logarithms + , scientific:template-haskell + , semialign:base + , semialign:containers + , semigroupoids:bifunctors + , serialise:base + , serialise:containers + , serialise:ghc-prim + , serialise:time + , singletons:base + , singletons-th:base + , singletons-th:singletons + , singletons-th:template-haskell + , singletons-th:th-desugar + , singletons-th:th-orphans + , size-based:template-haskell + , some:base + , splitmix:base + , statistics:parallel + , tagged:base + , tagged:template-haskell + , tasty:base + , tasty:tagged + , tasty-golden:tasty + , tasty-hedgehog:base + , tasty-hedgehog:hedgehog + , test-framework:time + , text:binary + , text:bytestring + , text:template-haskell + , text-iso8601:time + , text-short:base + , text-short:bytestring + , text-short:ghc-prim + , text-short:template-haskell + , th-abstraction:template-haskell + , th-compat:template-haskell + , th-desugar:template-haskell + , th-expand-syns:base + , th-expand-syns:containers + , th-expand-syns:template-haskell + , th-lift:template-haskell + , th-lift-instances:th-lift + , th-orphans:template-haskell + , these:base + , time-compat:base + , time-compat:deepseq + , time-compat:time + , transformers:base + , tree-diff:QuickCheck + , tree-diff:base + , tree-diff:containers + , tree-diff:time + , turtle:containers + , turtle:time + , typed-process:async + , universe-base:base + , universe-base:containers + , unix:time + , unordered-containers:hashable + , unordered-containers:template-haskell + , uuid-types:template-haskell + , vector-th-unbox:base + , vector-th-unbox:template-haskell + , wherefrom-compat:base + , wherefrom-compat:ghc-heap + , witherable:containers diff --git a/plutus-core/plutus-core/src/PlutusCore/Core/Instance/Eq.hs b/plutus-core/plutus-core/src/PlutusCore/Core/Instance/Eq.hs index 7a8f77c5ef2..836b28ecd1f 100644 --- a/plutus-core/plutus-core/src/PlutusCore/Core/Instance/Eq.hs +++ b/plutus-core/plutus-core/src/PlutusCore/Core/Instance/Eq.hs @@ -3,6 +3,7 @@ {-# OPTIONS_GHC -fno-warn-orphans #-} +{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeApplications #-} @@ -51,9 +52,14 @@ deriving stock instance (GEq uni, Closed uni, uni `Everywhere` Eq, Eq ann) => Eq (Type TyDeBruijn uni ann) -deriving stock instance (GEq uni, Closed uni, uni `Everywhere` Eq, Eq fun, Eq ann, - Eq (Term tyname name uni fun ann) - ) => Eq (Program tyname name uni fun ann) +deriving stock instance ( +#if __GLASGOW_HASKELL__ < 914 + -- These constraints are REQUIERD for ghc < 9.14 but REDUNDANT for ghc >= 9.14 + -- See https://gitlab.haskell.org/ghc/ghc/-/issues/26381#note_637863 + GEq uni, Closed uni, Eq fun, +#endif + uni `Everywhere` Eq, Eq ann, + Eq (Term tyname name uni fun ann) ) => Eq (Program tyname name uni fun ann) type EqRenameOf ren a = HasUniques a => a -> a -> EqRename ren diff --git a/plutus-core/plutus-core/src/PlutusCore/Error.hs b/plutus-core/plutus-core/src/PlutusCore/Error.hs index 864f451ba21..8eb5cd3e84a 100644 --- a/plutus-core/plutus-core/src/PlutusCore/Error.hs +++ b/plutus-core/plutus-core/src/PlutusCore/Error.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FunctionalDependencies #-} @@ -10,6 +11,12 @@ {-# OPTIONS_GHC -fno-warn-orphans #-} -- appears in the generated instances +#if __GLASGOW_HASKELL__ >= 914 +-- The `ghc-9.14` alpha release has what looks like a bug; +-- https://gitlab.haskell.org/ghc/ghc/-/issues/26381 +{-# OPTIONS_GHC -Wno-redundant-constraints #-} +#endif + module PlutusCore.Error ( ParserError (..) , ParserErrorBundle (..) diff --git a/plutus-core/plutus-ir/src/PlutusIR/Core/Instance/Flat.hs b/plutus-core/plutus-ir/src/PlutusIR/Core/Instance/Flat.hs index c4b04e8d12a..715acf071be 100644 --- a/plutus-core/plutus-ir/src/PlutusIR/Core/Instance/Flat.hs +++ b/plutus-core/plutus-ir/src/PlutusIR/Core/Instance/Flat.hs @@ -1,7 +1,15 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} + +#if __GLASGOW_HASKELL__ >= 914 +-- The `ghc-9.14` alpha release has what looks like a bug; +-- https://gitlab.haskell.org/ghc/ghc/-/issues/26381 +{-# OPTIONS_GHC -Wno-redundant-constraints #-} +#endif + module PlutusIR.Core.Instance.Flat () where import PlutusIR.Core.Type diff --git a/plutus-core/plutus-ir/test/PlutusCore/Generators/QuickCheck/SubstitutionTests.hs b/plutus-core/plutus-ir/test/PlutusCore/Generators/QuickCheck/SubstitutionTests.hs index d85f0f0c25e..bccab296519 100644 --- a/plutus-core/plutus-ir/test/PlutusCore/Generators/QuickCheck/SubstitutionTests.hs +++ b/plutus-core/plutus-ir/test/PlutusCore/Generators/QuickCheck/SubstitutionTests.hs @@ -1,4 +1,13 @@ -- editorconfig-checker-disable-file + +{-# LANGUAGE CPP #-} + +#if __GLASGOW_HASKELL__ >= 914 +-- The `ghc-9.14` alpha release has what looks like a bug; +-- https://gitlab.haskell.org/ghc/ghc/-/issues/26381 +{-# OPTIONS_GHC -Wno-redundant-constraints #-} +#endif + module PlutusCore.Generators.QuickCheck.SubstitutionTests where import PlutusCore.Generators.QuickCheck diff --git a/plutus-core/testlib/PlutusCore/Generators/QuickCheck/Common.hs b/plutus-core/testlib/PlutusCore/Generators/QuickCheck/Common.hs index aa3dc1ff471..8a20207f474 100644 --- a/plutus-core/testlib/PlutusCore/Generators/QuickCheck/Common.hs +++ b/plutus-core/testlib/PlutusCore/Generators/QuickCheck/Common.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE MultiParamTypeClasses #-} @@ -6,6 +7,12 @@ {-# OPTIONS_GHC -Wno-orphans #-} +#if __GLASGOW_HASKELL__ >= 914 +-- The `ghc-9.14` alpha release has what looks like a bug; +-- https://gitlab.haskell.org/ghc/ghc/-/issues/26381 +{-# OPTIONS_GHC -Wno-redundant-constraints #-} +#endif + module PlutusCore.Generators.QuickCheck.Common where import PlutusPrelude diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Core/Instance/Eq.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Core/Instance/Eq.hs index 64d617ad9d0..986001a5ab7 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Core/Instance/Eq.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Core/Instance/Eq.hs @@ -1,6 +1,7 @@ -- editorconfig-checker-disable-file {-# OPTIONS_GHC -fno-warn-orphans #-} +{-# LANGUAGE CPP #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeOperators #-} @@ -65,7 +66,13 @@ deriving stock instance instance HashableTermConstraints uni fun ann => Hashable (Term DeBruijn uni fun ann) -deriving stock instance (GEq uni, Closed uni, uni `Everywhere` Eq, Eq fun, Eq ann, +deriving stock instance ( +#if __GLASGOW_HASKELL__ < 914 + -- These constraints are REQUIERD for ghc < 9.14 but REDUNDANT for ghc >= 9.14 + -- See https://gitlab.haskell.org/ghc/ghc/-/issues/26381#note_637863 + GEq uni, Closed uni, Eq fun, +#endif + uni `Everywhere` Eq, Eq ann, Eq (Term name uni fun ann) ) => Eq (Program name uni fun ann) diff --git a/plutus-ledger-api/src/PlutusLedgerApi/V1/Interval.hs b/plutus-ledger-api/src/PlutusLedgerApi/V1/Interval.hs index b896562ec05..5ee476ddaac 100644 --- a/plutus-ledger-api/src/PlutusLedgerApi/V1/Interval.hs +++ b/plutus-ledger-api/src/PlutusLedgerApi/V1/Interval.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} @@ -13,6 +14,12 @@ {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} +#if __GLASGOW_HASKELL__ >= 914 +-- The `ghc-9.14` alpha release has what looks like a bug; +-- https://gitlab.haskell.org/ghc/ghc/-/issues/26381 +{-# OPTIONS_GHC -Wno-redundant-constraints #-} +#endif + -- | A type for intervals and associated functions. module PlutusLedgerApi.V1.Interval ( Interval(..) diff --git a/plutus-tx/src/PlutusTx/Blueprint/Schema.hs b/plutus-tx/src/PlutusTx/Blueprint/Schema.hs index f4b8a5e8eb5..cd457a6e7f4 100644 --- a/plutus-tx/src/PlutusTx/Blueprint/Schema.hs +++ b/plutus-tx/src/PlutusTx/Blueprint/Schema.hs @@ -1,4 +1,5 @@ {-# LANGUAGE AllowAmbiguousTypes #-} +{-# LANGUAGE CPP #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveDataTypeable #-} @@ -12,6 +13,12 @@ {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-} +#if __GLASGOW_HASKELL__ >= 914 +-- The `ghc-9.14` alpha release has what looks like a bug; +-- https://gitlab.haskell.org/ghc/ghc/-/issues/26381 +{-# OPTIONS_GHC -Wno-redundant-constraints #-} +#endif + module PlutusTx.Blueprint.Schema where import Control.Lens.Plated (Plated) diff --git a/plutus-tx/src/PlutusTx/Builtins/HasOpaque.hs b/plutus-tx/src/PlutusTx/Builtins/HasOpaque.hs index 55736bc52af..81c9658c06b 100644 --- a/plutus-tx/src/PlutusTx/Builtins/HasOpaque.hs +++ b/plutus-tx/src/PlutusTx/Builtins/HasOpaque.hs @@ -11,6 +11,12 @@ {-# OPTIONS_GHC -fno-omit-interface-pragmas #-} {-# OPTIONS_GHC -fno-specialise #-} +#if __GLASGOW_HASKELL__ >= 914 +-- The `ghc-9.14` alpha release has what looks like a bug; +-- https://gitlab.haskell.org/ghc/ghc/-/issues/26381 +{-# OPTIONS_GHC -Wno-redundant-constraints #-} +#endif + module PlutusTx.Builtins.HasOpaque where import Control.DeepSeq (NFData (..)) diff --git a/plutus-tx/src/PlutusTx/These.hs b/plutus-tx/src/PlutusTx/These.hs index 40000283173..45cdfae73f8 100644 --- a/plutus-tx/src/PlutusTx/These.hs +++ b/plutus-tx/src/PlutusTx/These.hs @@ -1,9 +1,16 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE LambdaCase #-} {-# OPTIONS_GHC -Wno-name-shadowing #-} {-# OPTIONS_GHC -fno-omit-interface-pragmas #-} +#if __GLASGOW_HASKELL__ >= 914 +-- The `ghc-9.14` alpha release has what looks like a bug; +-- https://gitlab.haskell.org/ghc/ghc/-/issues/26381 +{-# OPTIONS_GHC -Wno-redundant-constraints #-} +#endif + module PlutusTx.These ( These (..), these, diff --git a/plutus-tx/test/Show/Spec.hs b/plutus-tx/test/Show/Spec.hs index ac13a3ba86d..b740f58c588 100644 --- a/plutus-tx/test/Show/Spec.hs +++ b/plutus-tx/test/Show/Spec.hs @@ -1,7 +1,14 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} +#if __GLASGOW_HASKELL__ >= 914 +-- The `ghc-9.14` alpha release has what looks like a bug; +-- https://gitlab.haskell.org/ghc/ghc/-/issues/26381 +{-# OPTIONS_GHC -Wno-redundant-constraints #-} +#endif + module Show.Spec where import PlutusTx.Bool