Skip to content

Commit

Permalink
Support ghc-9.12
Browse files Browse the repository at this point in the history
  • Loading branch information
erikd committed Nov 8, 2024
1 parent 391a2c5 commit 1fda537
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 20 deletions.
52 changes: 50 additions & 2 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ repository cardano-haskell-packages
d4a35cd3121aa00d18544bb0ac01c3e1691d618f462c46129271bccf39f7e8ee

-- The hackage index-state
index-state: 2024-10-10T00:52:24Z
index-state: 2024-11-07T03:32:13Z
-- The CHaP index-state
index-state: cardano-haskell-packages 2024-10-10T04:22:19Z
index-state: cardano-haskell-packages 2024-11-05T09:09:23Z

packages:
base-deriving-via
Expand Down Expand Up @@ -42,3 +42,51 @@ program-options
package bitvec
-- Workaround for windows cross-compilation
flags: -simd

allow-newer:
, aeson:time
, assoc:base
, async:base
, binary-orphans:base
, boring:base
, cborg:base
, data-fix:base
, generically:base
, hashable:base
, hsc2hs:base
, io-classes:base
, io-classes:time
, indexed-traversable:base
, indexed-traversable-instances:base
, integer-conversion:base
, integer-logarithms:base
, lifted-async:base
, microstache:base
, OneTuple:base
, parallel:base
, primitive:base
, quickcheck-instances:base
, scientific:base
, semialign:base
, serialise:base
, splitmix:base
, text-iso8601:time
, text-short:base
, these:base
, time:base
, time-compat:base
, time-compat:time
, tree-diff:base
, tree-diff:time
, vector:base
, vector-stream:base
, vector-th-unbox:base

source-repository-package
type: git
location: https://github.com/IntersectMBO/cardano-prelude
tag: 533345b47c10ea5fbbff0068ddac11d9950178f4
--sha256: 0yi06z2ipk7hz6ahgbqrynacqj29653fnrvyvsag14vkpw1wnlbi
subdir:
cardano-prelude
cardano-prelude-test
3 changes: 3 additions & 0 deletions cardano-crypto-tests/cardano-crypto-tests.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ library
Test.Crypto.Vector.StringConstants
Test.Crypto.Vector.Vectors

if impl(ghc >= 9.12)
ghc-options: -Wno-deriving-typeable

test-suite test-crypto
import: base, project-config
type: exitcode-stdio-1.0
Expand Down
36 changes: 18 additions & 18 deletions orphans-deriving-via/src/Data/DerivingVia/NoThunks.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ module Data.DerivingVia.NoThunks
)
where

import Data.DerivingVia
import Data.Proxy
import GHC.Generics
import NoThunks.Class

-- | Copied from the "NoThunks.Class" default method definitions
instance (Generic a, GShowTypeOf (Rep a), GWNoThunks '[] (Rep a))
=> NoThunks (InstantiatedAt Generic a) where
wNoThunks ctxt (InstantiatedAt x) =
gwNoThunks (Proxy @'[]) ctxt fp
where
!fp = from x

showTypeOf _ = gShowTypeOf (from (undefined :: a))

-- Copied from the "NoThunks.Class"
class GShowTypeOf f where gShowTypeOf :: f x -> String
instance Datatype c => GShowTypeOf (D1 c f) where gShowTypeOf = datatypeName
-- import Data.DerivingVia
-- import Data.Proxy
-- import GHC.Generics
-- import NoThunks.Class
--
-- -- | Copied from the "NoThunks.Class" default method definitions
-- instance (Generic a, GShowTypeOf (Rep a), GWNoThunks '[] (Rep a))
-- => NoThunks (InstantiatedAt Generic a) where
-- wNoThunks ctxt (InstantiatedAt x) =
-- gwNoThunks (Proxy @'[]) ctxt fp
-- where
-- !fp = from x
--
-- showTypeOf _ = gShowTypeOf (from (undefined :: a))
--
-- -- Copied from the "NoThunks.Class"
-- class GShowTypeOf f where gShowTypeOf :: f x -> String
-- instance Datatype c => GShowTypeOf (D1 c f) where gShowTypeOf = datatypeName

0 comments on commit 1fda537

Please sign in to comment.