Skip to content

Commit 9597702

Browse files
committed
Preliminary ghc 9.14 support
Currently using ghc-9.14.0.20251007.
1 parent 5026478 commit 9597702

File tree

127 files changed

+1659
-96
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+1659
-96
lines changed

cabal.project

Lines changed: 214 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,218 @@ benchmarks: true
9292
-- The only sensible test display option
9393
test-show-details: streaming
9494

95-
if impl(ghc >=9.12)
95+
allow-newer:
96+
-- https://github.com/phadej/vec/issues/121
97+
, ral:QuickCheck
98+
, fin:QuickCheck
99+
, bin:QuickCheck
100+
101+
if impl(ghc >=9.14)
102+
source-repository-package
103+
type: git
104+
-- https://github.com/snowleopard/alga/issues/322
105+
location: https://github.com/snowleopard/alga/
106+
tag: d4e43fb42db05413459fb2df493361d5a666588a
107+
108+
source-repository-package
109+
type: git
110+
location: https://github.com/IntersectMBO/plutus
111+
tag: b282990dc107e861fc97239d69d93b1c8f0b12e8
112+
subdir:
113+
plutus-core
114+
plutus-tx
115+
plutus-ledger-api
116+
117+
if impl (ghc >= 9.14)
118+
constraints:
119+
, containers > 0.7
120+
, foldl >= 1.4.18
121+
, nothunks ^>= 0.2
122+
, microlens ^>= 0.4
123+
, microlens-th < 0.4.3.18
124+
-- Newest version causes Arbitrary instance clashes in quickcheck-instances.
125+
, QuickCheck < 2.17.0.0
126+
127+
-- cabal-allow-newer
128+
if impl (ghc >= 9.14)
96129
allow-newer:
97-
-- Unique: https://github.com/kapralVV/Unique/issues/11
98-
, Unique:hashable
130+
, OneTuple:base
131+
, aeson:base
132+
, aeson:bytestring
133+
, aeson:containers
134+
, aeson:deepseq
135+
, aeson:ghc-prim
136+
, aeson:template-haskell
137+
, aeson:text-short
138+
, aeson:time
139+
, aeson:witherable
140+
, assoc:base
141+
, async:base
142+
, base:ghc-internal
143+
, base:ghc-prim
144+
, base64-bytestring-type:base
145+
, base64-bytestring-type:http-api-data
146+
, bifunctors:containers
147+
, bifunctors:template-haskell
148+
, bin:base
149+
, binary-orphans:base
150+
, boring:base
151+
, boring:tagged
152+
, brick:base
153+
, canonical-json:containers
154+
, cborg:base
155+
, cborg:containers
156+
, concurrent-output:process
157+
, config-ini:containers
158+
, config-ini:megaparsec
159+
, constraints:boring
160+
, constraints:hashable
161+
, constraints-extras:base
162+
, constraints-extras:template-haskell
163+
, containers:base
164+
, containers:deepseq
165+
, containers:template-haskell
166+
, cuddle:foldable1-classes-compat
167+
, cuddle:megaparsec
168+
, data-default:containers
169+
, data-default-class:data-default
170+
, data-fix:base
171+
, dec:base
172+
, deepseq:base
173+
, deepseq:ghc-prim
174+
, dependent-map:constraints-extras
175+
, dependent-map:containers
176+
, deriving-compat:containers
177+
, deriving-compat:template-haskell
178+
, dictionary-sharing:containers
179+
, directory:base
180+
, directory:time
181+
, dom-lt:containers
182+
, filepath:bytestring
183+
, filepath:template-haskell
184+
, fin:base
185+
, fin:universe-base
186+
, foldable1-classes-compat:base
187+
, foldl:containers
188+
, free:containers
189+
, free:template-haskell
190+
, free:transformers
191+
, generically:base
192+
, ghc-heap:containers
193+
, ghc-heap:ghc-internal
194+
, hashable:base
195+
, hashable:bytestring
196+
, hashable:containers
197+
, hashable:ghc-bignum
198+
, hashable:ghc-prim
199+
, hedgehog:async
200+
, hedgehog:containers
201+
, hedgehog:template-haskell
202+
, hedgehog:time
203+
, hsc2hs:base
204+
, http-api-data:base
205+
, http-api-data:containers
206+
, indexed-traversable:base
207+
, indexed-traversable:containers
208+
, indexed-traversable-instances:base
209+
, integer-conversion:base
210+
, integer-logarithms:base
211+
, integer-logarithms:ghc-bignum
212+
, io-classes:base
213+
, io-classes:time
214+
, ledger-state:persistent
215+
, lens:containers
216+
, lens:parallel
217+
, lens:template-haskell
218+
, megaparsec:containers
219+
, microlens-th:containers
220+
, microlens-th:template-haskell
221+
, microstache:base
222+
, microstache:containers
223+
, monoidal-containers:base
224+
, monoidal-containers:containers
225+
, nonempty-vector:base
226+
, nothunks:containers
227+
, nothunks:time
228+
, nothunks:wherefrom-compat
229+
, optics-core:containers
230+
, ordered-containers:containers
231+
, parallel:base
232+
, persistent:template-haskell
233+
, persistent-sqlite:persistent
234+
, plutus-core:dependent-map
235+
, primitive:base
236+
, process:base
237+
, process:directory
238+
, quickcheck-instances:base
239+
, quickcheck-instances:containers
240+
, quickcheck-instances:data-fix
241+
, quickcheck-instances:time-compat
242+
, ral:base
243+
, recursion-schemes:containers
244+
, recursion-schemes:template-haskell
245+
, scientific:base
246+
, scientific:containers
247+
, scientific:template-haskell
248+
, semialign:base
249+
, semialign:containers
250+
, semialign:indexed-traversable
251+
, semialign:indexed-traversable-instances
252+
, semigroupoids:bifunctors
253+
, serialise:base
254+
, serialise:containers
255+
, serialise:ghc-prim
256+
, serialise:these
257+
, serialise:time
258+
, singletons:base
259+
, singletons-th:base
260+
, singletons-th:singletons
261+
, singletons-th:template-haskell
262+
, singletons-th:th-desugar
263+
, singletons-th:th-orphans
264+
, size-based:template-haskell
265+
, some:base
266+
, splitmix:base
267+
, tagged:template-haskell
268+
, tasty-hedgehog:base
269+
, text:bytestring
270+
, text-iso8601:time
271+
, text-short:base
272+
, text-short:ghc-prim
273+
, text-short:template-haskell
274+
, th-abstraction:containers
275+
, th-abstraction:template-haskell
276+
, th-compat:template-haskell
277+
, th-desugar:template-haskell
278+
, th-expand-syns:base
279+
, th-expand-syns:containers
280+
, th-expand-syns:template-haskell
281+
, th-lift:template-haskell
282+
, th-lift-instances:th-lift
283+
, th-orphans:template-haskell
284+
, these:assoc
285+
, these:base
286+
, time-compat:base
287+
, time-compat:time
288+
, transformers:base
289+
, tree-diff:aeson
290+
, tree-diff:base
291+
, tree-diff:containers
292+
, tree-diff:scientific
293+
, tree-diff:semialign
294+
, tree-diff:time
295+
, tree-diff:unordered-containers
296+
, universe-base:base
297+
, universe-base:containers
298+
, unordered-containers:base
299+
, unordered-containers:template-haskell
300+
, uuid-types:deepseq
301+
, uuid-types:template-haskell
302+
, validation-selective:base
303+
, vault:base
304+
, vault:containers
305+
, vector-th-unbox:base
306+
, vector-th-unbox:template-haskell
307+
, wherefrom-compat:base
308+
, wherefrom-compat:ghc-heap
309+
, witherable:containers

eras/allegra/impl/src/Cardano/Ledger/Allegra/Scripts.hs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,13 @@ module Cardano.Ledger.Allegra.Scripts (
4141
mkTimeExpireTimelock,
4242
getTimeExpireTimelock,
4343
Timelock (MkTimelock, TimelockConstr),
44+
#if __GLASGOW_HASKELL__ >= 914
45+
data RequireTimeExpire,
46+
data RequireTimeStart,
47+
#else
4448
pattern RequireTimeExpire,
4549
pattern RequireTimeStart,
50+
#endif
4651
TimelockRaw (..),
4752
inInterval,
4853
showTimelock,
@@ -92,10 +97,17 @@ import Cardano.Ledger.MemoBytes.Internal (mkMemoBytes)
9297
import Cardano.Ledger.Shelley.Scripts (
9398
ShelleyEraScript (..),
9499
nativeMultiSigTag,
100+
#if __GLASGOW_HASKELL__ >= 914
101+
data RequireAllOf,
102+
data RequireAnyOf,
103+
data RequireMOf,
104+
data RequireSignature,
105+
#else
95106
pattern RequireAllOf,
96107
pattern RequireAnyOf,
97108
pattern RequireMOf,
98109
pattern RequireSignature,
110+
#endif
99111
)
100112
import Cardano.Slotting.Slot (SlotNo (..))
101113
import Control.DeepSeq (NFData (..))

eras/allegra/impl/testlib/Test/Cardano/Ledger/Allegra/Arbitrary.hs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE CPP #-}
12
{-# LANGUAGE DataKinds #-}
23
{-# LANGUAGE DerivingStrategies #-}
34
{-# LANGUAGE FlexibleContexts #-}
@@ -25,16 +26,29 @@ import Cardano.Ledger.Allegra.Scripts (
2526
AllegraEraScript (..),
2627
Timelock (..),
2728
ValidityInterval (..),
29+
#if __GLASGOW_HASKELL__ >= 914
30+
data RequireTimeExpire,
31+
data RequireTimeStart,
32+
#else
2833
pattern RequireTimeExpire,
2934
pattern RequireTimeStart,
35+
#endif
3036
)
3137
import Cardano.Ledger.Allegra.Transition
3238
import Cardano.Ledger.Allegra.TxAuxData (AllegraTxAuxData (..))
39+
#if __GLASGOW_HASKELL__ >= 914
40+
import Cardano.Ledger.Allegra.TxBody (data AllegraTxBody)
41+
#else
3342
import Cardano.Ledger.Allegra.TxBody (pattern AllegraTxBody)
43+
#endif
3444
import Cardano.Ledger.Core
3545
import Cardano.Ledger.Shelley.API (ShelleyTxAuxData (ShelleyTxAuxData))
3646
import Cardano.Ledger.Shelley.Scripts (
47+
#if __GLASGOW_HASKELL__ >= 914
48+
data RequireSignature,
49+
#else
3750
pattern RequireSignature,
51+
#endif
3852
)
3953
import Data.Sequence.Strict (StrictSeq, fromList)
4054
import Generic.Random (genericArbitraryU)
@@ -69,7 +83,11 @@ instance
6983
forall era.
7084
( AllegraEraScript era
7185
, Arbitrary (NativeScript era)
86+
#if __GLASGOW_HASKELL__ < 914
87+
-- These constraints are REQUIRED for ghc < 9.14 but REDUNDANT for ghc >= 9.14
88+
-- See https://gitlab.haskell.org/ghc/ghc/-/issues/26381#note_637863
7289
, Arbitrary (Script era)
90+
#endif
7391
, Era era
7492
) =>
7593
Arbitrary (AllegraTxAuxData era)

eras/allegra/impl/testlib/Test/Cardano/Ledger/Allegra/ImpTest.hs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE CPP #-}
12
{-# LANGUAGE DataKinds #-}
23
{-# LANGUAGE FlexibleContexts #-}
34
{-# LANGUAGE LambdaCase #-}
@@ -18,14 +19,26 @@ import Cardano.Ledger.Allegra.Scripts (
1819
AllegraEraScript,
1920
Timelock,
2021
evalTimelock,
22+
#if __GLASGOW_HASKELL__ >= 914
23+
data RequireTimeExpire,
24+
data RequireTimeStart,
25+
#else
2126
pattern RequireTimeExpire,
2227
pattern RequireTimeStart,
28+
#endif
2329
)
2430
import Cardano.Ledger.Shelley.Scripts (
31+
#if __GLASGOW_HASKELL__ >= 914
32+
data RequireAllOf,
33+
data RequireAnyOf,
34+
data RequireMOf,
35+
data RequireSignature,
36+
#else
2537
pattern RequireAllOf,
2638
pattern RequireAnyOf,
2739
pattern RequireMOf,
2840
pattern RequireSignature,
41+
#endif
2942
)
3043
import qualified Data.Map.Strict as Map
3144
import qualified Data.Set as Set

eras/alonzo/impl/src/Cardano/Ledger/Alonzo.hs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
{-# LANGUAGE CPP #-}
12
{-# LANGUAGE DataKinds #-}
23
{-# LANGUAGE FlexibleContexts #-}
34
{-# LANGUAGE FlexibleInstances #-}
45
{-# LANGUAGE PatternSynonyms #-}
56
{-# LANGUAGE ScopedTypeVariables #-}
67
{-# LANGUAGE TypeApplications #-}
8+
{-# LANGUAGE TypeFamilies #-}
79
{-# LANGUAGE UndecidableInstances #-}
810
{-# OPTIONS_GHC -Wno-orphans #-}
911

@@ -12,7 +14,11 @@ module Cardano.Ledger.Alonzo (
1214
AlonzoEra,
1315
AlonzoTxOut,
1416
MaryValue,
17+
#if __GLASGOW_HASKELL__ >= 914
18+
data AlonzoTxBody,
19+
#else
1520
pattern AlonzoTxBody,
21+
#endif
1622
AlonzoScript,
1723
AlonzoTxAuxData,
1824
Tx (..),

eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Core.hs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
{-# LANGUAGE CPP #-}
12
{-# LANGUAGE PatternSynonyms #-}
3+
{-# LANGUAGE TypeFamilies #-}
24

35
module Cardano.Ledger.Alonzo.Core (
46
AlonzoEraTx (..),
@@ -8,10 +10,17 @@ module Cardano.Ledger.Alonzo.Core (
810
AsIx (..),
911
AsItem (..),
1012
AsIxItem (..),
13+
#if __GLASGOW_HASKELL__ >= 914
14+
data SpendingPurpose,
15+
data MintingPurpose,
16+
data CertifyingPurpose,
17+
data RewardingPurpose,
18+
#else
1119
pattern SpendingPurpose,
1220
pattern MintingPurpose,
1321
pattern CertifyingPurpose,
1422
pattern RewardingPurpose,
23+
#endif
1524
ScriptIntegrityHash,
1625
AlonzoEraTxBody (..),
1726
AlonzoEraTxWits (..),
@@ -62,10 +71,17 @@ import Cardano.Ledger.Alonzo.Scripts (
6271
AsItem (..),
6372
AsIx (..),
6473
AsIxItem (..),
74+
#if __GLASGOW_HASKELL__ >= 914
75+
data CertifyingPurpose,
76+
data MintingPurpose,
77+
data RewardingPurpose,
78+
data SpendingPurpose,
79+
#else
6580
pattern CertifyingPurpose,
6681
pattern MintingPurpose,
6782
pattern RewardingPurpose,
6883
pattern SpendingPurpose,
84+
#endif
6985
)
7086
import Cardano.Ledger.Alonzo.Tx (AlonzoEraTx (..), IsValid (..))
7187
import Cardano.Ledger.Alonzo.TxAuxData (AlonzoEraTxAuxData (..))

0 commit comments

Comments
 (0)