Skip to content

Commit

Permalink
Build with ghc-9.6
Browse files Browse the repository at this point in the history
  • Loading branch information
coot committed Mar 27, 2023
1 parent d4f1f58 commit 084cea9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ghc: ["8.10.7", "9.0.2", "9.2.4", "9.4.2"]
ghc: ["8.10.7", "9.0.2", "9.2.4", "9.4.2", "9.6.1"]
env:
CONFIG: "--enable-tests"
steps:
Expand All @@ -24,6 +24,11 @@ jobs:
ghc-version: ${{ matrix.ghc }}
cabal-version: 3.6.2.0
- run: cabal update
# TODO: remove once hedgehog is compatible with ghc-9.6
- name: "Support ghc-9.6"
if: matrix.ghc == '9.6.1'
run: |
echo "allow-newer: hedgehog:template-haskell" >> cabal.project.local
- run: cabal freeze $CONFIG
- uses: actions/cache@v2
with:
Expand Down
4 changes: 2 additions & 2 deletions nothunks.cabal
@@ -1,4 +1,4 @@
cabal-version: 2.4
cabal-version: 3.0
name: nothunks
version: 0.1.3
synopsis: Examine values for unexpected thunks
Expand All @@ -15,7 +15,7 @@ maintainer: operations@iohk.io
copyright: 2018-2021 IOHK
category: Development
extra-source-files: CHANGELOG.md
tested-with: GHC==8.10.7, GHC==9.0.2, GHC==9.2.4, GHC==9.4.2
tested-with: GHC== { 8.10.7, 9.0.2, 9.2.4, 9.4.2, 9.6.1 }

source-repository head
type: git
Expand Down
6 changes: 4 additions & 2 deletions src/NoThunks/Class.hs
Expand Up @@ -202,8 +202,10 @@ data ThunkInfo = ThunkInfo {
-- > ---------------------------------------------------------------------
-- > ["(,)"] the pair itself
-- > ["Int","(,)"] the Int in the pair
-- > ["[]","(,)"] the [Int] in the pair
-- > ["Int","[]","(,)"] an Int in the [Int] in the pair
-- > ["List","(,)"] the [Int] in the pair
-- > ["Int","List","(,)"] an Int in the [Int] in the pair
--
-- Note: prior to `ghc-9.6` a list was indicated by `[]`.
thunkContext :: Context
}
deriving (Show)
Expand Down
5 changes: 5 additions & 0 deletions test/Test/NoThunks/Class.hs
@@ -1,4 +1,5 @@
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveGeneric #-}
Expand Down Expand Up @@ -241,7 +242,11 @@ instance FromModel a => FromModel [a] where
ListNil -> IsNF
ListCons x xs' -> constrNF [modelIsNF ctxt' x, modelIsNF ctxt xs']
where
#if MIN_VERSION_GLASGOW_HASKELL(9,6,0,0)
ctxt' = "List" : ctxt
#else
ctxt' = "[]" : ctxt
#endif

fromModel (ListThunk xs) k = fromModel xs $ \xs' -> k (if ack 3 3 > 0 then xs' else xs')
fromModel ListNil k = k []
Expand Down

0 comments on commit 084cea9

Please sign in to comment.