Skip to content
Draft
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
154 changes: 143 additions & 11 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -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 2026-01-05T22:32:33Z
-- Bump this if you need newer packages from CHaP
, cardano-haskell-packages 2025-09-18T12:21:32Z
, cardano-haskell-packages 2026-01-05T11:07:19Z

packages: cardano-constitution
plutus-benchmark
Expand Down Expand Up @@ -75,16 +75,148 @@ 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
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

if impl (ghc >= 9.14)
constraints:
-- Newest version causes Arbitrary instance clashes in quickcheck-instances.
, QuickCheck < 2.17.0.0
, brick >= 2.10

allow-newer:
-- https://github.com/haskell/aeson/issues/1155
, aeson:OneTuple
, aeson:containers
, aeson:data-fix
, aeson:indexed-traversable
, aeson:scientific
, aeson:semialign
, aeson:template-haskell
, aeson:text-iso8601
, aeson:these
, aeson:time
, aeson:time-compat

-- https://github.com/simonmar/async/issues/175
, async:base

-- https://github.com/jtdaugherty/brick/issues/543
, brick:base

-- https://github.com/well-typed/cborg/issues/373
, cborg:base
, cborg:containers
, cborg:ghc-prim

-- https://github.com/hedgehogqa/haskell-hedgehog/issues/566
, hedgehog:bytestring
, hedgehog:template-haskell
, hedgehog:time
, hedgehog-fn:hedgehog

-- https://github.com/well-typed/cborg/issues/373
, serialise:base
, serialise:containers
, serialise:time


-- cabal-allow-newer
if impl (ghc >= 9.14)
allow-newer:
, OneTuple:base
, QuickCheck:base
, bin:base
, binary:containers
, binary-orphans:base
, boring:base
, config-ini:containers
, constraints-extras:base
, constraints-extras:template-haskell
, containers:base
, containers:template-haskell
, dec:base
, deepseq:base
, dependent-map:containers
, deriving-compat:containers
, deriving-compat:template-haskell
, dictionary-sharing:containers
, directory:time
, filepath:deepseq
, fin:base
, fin:universe-base
, foldl:containers
, free:mtl
, free:template-haskell
, indexed-traversable:base
, indexed-traversable:containers
, indexed-traversable-instances:base
, lens:containers
, lens:free
, lens:template-haskell
, list-t:foldl
, microlens-th:containers
, microlens-th:template-haskell
, microstache:base
, microstache:containers
, monoidal-containers:base
, monoidal-containers:containers
, nonempty-vector:base
, nothunks:time
, ordered-containers:containers
, os-string:template-haskell
, parsec:mtl
, parsec:text
, quickcheck-instances:QuickCheck
, quickcheck-instances:base
, quickcheck-instances:containers
, ral:base
, recursion-schemes:base-orphans
, recursion-schemes:containers
, recursion-schemes:template-haskell
, semialign:base
, semialign:containers
, 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
, text:template-haskell
, text-iso8601:time
, th-desugar:template-haskell
, th-expand-syns:base
, th-expand-syns:containers
, th-expand-syns:template-haskell
, th-orphans:template-haskell
, these:base
, time-compat:base
, time-compat:deepseq
, time-compat:time
, tree-diff:QuickCheck
, tree-diff:base
, tree-diff:containers
, tree-diff:time
, turtle:containers
, turtle:time
, universe-base:base
, universe-base:containers
, unix:time
, uuid-types:template-haskell
, vector-th-unbox:base
, vector-th-unbox:template-haskell
2 changes: 1 addition & 1 deletion plutus-core/plutus-core.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ executable plutus
, singletons-th
, text
, text-zipper
, vty ^>=6.2
, vty ^>=6.5
, vty-crossplatform ^>=0.4

ghc-options: -O2 -threaded -rtsopts -with-rtsopts=-N
Expand Down
19 changes: 10 additions & 9 deletions plutus-core/plutus-core/src/PlutusCore/Core/Instance/Eq.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeApplications #-}
Expand All @@ -8,6 +9,7 @@
{-# OPTIONS_GHC -fno-warn-orphans #-}

-- | 'Eq' instances for core data types.

module PlutusCore.Core.Instance.Eq () where

import PlutusPrelude
Expand Down Expand Up @@ -55,15 +57,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 REQUIRED 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

Expand Down
51 changes: 36 additions & 15 deletions plutus-core/plutus-core/src/PlutusCore/Error.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
Expand Down Expand Up @@ -81,15 +83,16 @@ deriving stock instance
=> Show (NormCheckError tyname name uni fun ann)

deriving stock instance
( Eq (Term tyname name uni fun ann)
, Eq (Type tyname uni ann)
, GEq uni
, Closed uni
, uni `Everywhere` Eq
, Eq fun
, Eq ann
)
=> Eq (NormCheckError tyname name uni fun ann)
( Eq (Term tyname name uni fun ann)
, Eq (Type tyname uni ann)
#if __GLASGOW_HASKELL__ < 914
-- These constraints are REQUIRED 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 (NormCheckError tyname name uni fun ann)

{-| This is needed for nice kind/type checking error messages. In some cases the type checker knows
the exact type that an expression has to have for type checking to succeed (see any of
Expand Down Expand Up @@ -156,16 +159,34 @@ data Error uni fun ann
deriving stock (Generic, Functor)

deriving stock instance
(Eq fun, Eq ann, Closed uni, Everywhere uni Eq, GEq uni, Eq ParserError)
=> Eq (Error uni fun ann)
(Eq fun, Eq ann, Closed uni, Everywhere uni Eq, GEq uni
#if __GLASGOW_HASKELL__ < 914
-- These constraints are REQUIRED for ghc < 9.14 but REDUNDANT for ghc >= 9.14
-- See https://gitlab.haskell.org/ghc/ghc/-/issues/26381#note_637863
, Eq ParserError
#endif
) =>
Eq (Error uni fun ann)

deriving anyclass instance
(NFData fun, NFData ann, Closed uni, Everywhere uni NFData, NFData ParserError)
=> NFData (Error uni fun ann)
(NFData fun, NFData ann, Closed uni, Everywhere uni NFData
#if __GLASGOW_HASKELL__ < 914
-- These constraints are REQUIRED for ghc < 9.14 but REDUNDANT for ghc >= 9.14
-- See https://gitlab.haskell.org/ghc/ghc/-/issues/26381#note_637863
, NFData ParserError
#endif
) =>
NFData (Error uni fun ann)

deriving stock instance
(Show fun, Show ann, Closed uni, Everywhere uni Show, GShow uni, Show ParserError)
=> Show (Error uni fun ann)
(Show fun, Show ann, Closed uni, Everywhere uni Show, GShow uni
#if __GLASGOW_HASKELL__ < 914
-- These constraints are REQUIRED for ghc < 9.14 but REDUNDANT for ghc >= 9.14
-- See https://gitlab.haskell.org/ghc/ghc/-/issues/26381#note_637863
, Show ParserError
#endif
) =>
Show (Error uni fun ann)

instance Pretty SourcePos where
pretty = pretty . sourcePosPretty
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeOperators #-}
Expand Down Expand Up @@ -66,15 +67,15 @@ 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
, Eq (Term name uni fun ann)
)
=> Eq (Program name uni fun ann)
deriving stock instance (
#if __GLASGOW_HASKELL__ < 914
-- These constraints are REQUIRED 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)

-- | Check equality of two 'Term's.
eqTermM
Expand Down
12 changes: 9 additions & 3 deletions plutus-tx/src/PlutusTx/BuiltinList.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{-# LANGUAGE CPP #-}

{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}

{-# HLINT ignore "Redundant if" #-}
Expand Down Expand Up @@ -283,9 +285,13 @@ reverse xs = revAppend xs empty

-- | Plutus Tx version of 'Data.List.zip' for 'BuiltinList'.
_zip
:: forall a b
. (MkNil a, MkNil b)
=> BuiltinList a
:: forall a b .
#if __GLASGOW_HASKELL__ < 914
-- These constraints are REQUIRED for ghc < 9.14 but REDUNDANT for ghc >= 9.14
-- See https://gitlab.haskell.org/ghc/ghc/-/issues/26381#note_637863
(MkNil a, MkNil b) =>
#endif
BuiltinList a
-> BuiltinList b
-> BuiltinList (BuiltinPair a b)
_zip = zipWith (curry BI.BuiltinPair)
Expand Down
22 changes: 17 additions & 5 deletions plutus-tx/src/PlutusTx/Builtins/HasOpaque.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ import PlutusCore.Pretty (Pretty (..))
import PlutusTx.Base (id)
import PlutusTx.Bool (Bool (..))
import PlutusTx.Builtins.Internal
( BuiltinArray
, BuiltinBLS12_381_G1_Element
( BuiltinBLS12_381_G1_Element
, BuiltinBLS12_381_G2_Element
, BuiltinBLS12_381_MlResult
, BuiltinByteString (..)
Expand Down Expand Up @@ -292,9 +291,22 @@ instance MkNil BuiltinData
instance MkNil BuiltinValue
instance MkNil BuiltinBLS12_381_G1_Element
instance MkNil BuiltinBLS12_381_G2_Element
instance MkNil a => MkNil (BuiltinList a)
instance MkNil a => MkNil (BuiltinArray a)
instance (MkNil a, MkNil b) => MkNil (BuiltinPair a b)

instance
#if __GLASGOW_HASKELL__ < 914
-- This constraint is REQUIRED for ghc < 9.14 but REDUNDANT for ghc >= 9.14
-- See https://gitlab.haskell.org/ghc/ghc/-/issues/26381#note_637863
(MkNil a) =>
#endif
MkNil (BuiltinList a)

instance
#if __GLASGOW_HASKELL__ < 914
-- These constraints are REQUIRED for ghc < 9.14 but REDUNDANT for ghc >= 9.14
-- See https://gitlab.haskell.org/ghc/ghc/-/issues/26381#note_637863
(MkNil a, MkNil b) =>
#endif
MkNil (BuiltinPair a b)

instance (HasToOpaque a arep, MkNil arep) => HasToOpaque [a] (BuiltinList arep) where
toOpaque = goList
Expand Down
2 changes: 1 addition & 1 deletion plutus-tx/src/PlutusTx/Enum/TH.hs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ deriveEnum name = do
<$> instanceD
(pure [])
(pure instanceType)
[ funD 'succ (fmap (deriveSuccPred Succ) (zip cons (tail (Just <$> cons) ++ [Nothing])))
[ funD 'succ (fmap (deriveSuccPred Succ) (zip cons (drop 1 $ (Just <$> cons) ++ [Nothing])))
, TH.pragInlD 'succ TH.Inlinable TH.FunLike TH.AllPhases
, funD 'pred (fmap (deriveSuccPred Pred) (zip cons (Nothing : init (Just <$> cons))))
, TH.pragInlD 'pred TH.Inlinable TH.FunLike TH.AllPhases
Expand Down
Loading