Skip to content
Merged
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
58 changes: 49 additions & 9 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.19.20250605
# version: 0.19.20250917
#
# REGENDATA ("0.19.20250605",["github","--config=cabal.haskell-ci","cabal.project"])
# REGENDATA ("0.19.20250917",["github","--config=cabal.haskell-ci","cabal.project"])
#
name: Haskell-CI
on:
- push
- pull_request
- merge_group
jobs:
linux:
name: Haskell-CI - Linux - ${{ matrix.compiler }}
Expand All @@ -28,14 +29,19 @@ jobs:
strategy:
matrix:
include:
- compiler: ghc-9.14.0.20250908
compilerKind: ghc
compilerVersion: 9.14.0.20250908
setup-method: ghcup-prerelease
allow-failure: false
- compiler: ghc-9.12.2
compilerKind: ghc
compilerVersion: 9.12.2
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.10.2
- compiler: ghc-9.10.3
compilerKind: ghc
compilerVersion: 9.10.2
compilerVersion: 9.10.3
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.8.4
Expand Down Expand Up @@ -106,8 +112,8 @@ jobs:
chmod a+x "$HOME/.ghcup/bin/ghcup"
- name: Install cabal-install
run: |
"$HOME/.ghcup/bin/ghcup" install cabal 3.14.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
echo "CABAL=$HOME/.ghcup/bin/cabal-3.14.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
"$HOME/.ghcup/bin/ghcup" install cabal 3.16.0.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
echo "CABAL=$HOME/.ghcup/bin/cabal-3.16.0.0 -vnormal+nowrap" >> "$GITHUB_ENV"
- name: Install GHC (GHCup)
if: matrix.setup-method == 'ghcup'
run: |
Expand All @@ -122,6 +128,21 @@ jobs:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
HCVER: ${{ matrix.compilerVersion }}
- name: Install GHC (GHCup prerelease)
if: matrix.setup-method == 'ghcup-prerelease'
run: |
"$HOME/.ghcup/bin/ghcup" config add-release-channel prereleases
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
HCVER: ${{ matrix.compilerVersion }}
- name: Set PATH and environment variables
run: |
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
Expand All @@ -132,7 +153,7 @@ jobs:
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
if [ $((HCNUMVER >= 91400)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
env:
HCKIND: ${{ matrix.compilerKind }}
Expand Down Expand Up @@ -160,6 +181,18 @@ jobs:
repository hackage.haskell.org
url: http://hackage.haskell.org/
EOF
if $HEADHACKAGE; then
cat >> $CABAL_CONFIG <<EOF
repository head.hackage.ghc.haskell.org
url: https://ghc.gitlab.haskell.org/head.hackage/
secure: True
root-keys: 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
key-threshold: 3
active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override
EOF
fi
cat >> $CABAL_CONFIG <<EOF
program-default-options
ghc-options: $GHCJOBS +RTS -M3G -RTS
Expand All @@ -183,7 +216,7 @@ jobs:
chmod a+x $HOME/.cabal/bin/cabal-plan
cabal-plan --version
- name: checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
path: source
- name: initial cabal.project for sdist
Expand All @@ -208,11 +241,18 @@ jobs:
touch cabal.project.local
echo "packages: ${PKGDIR_text_show}" >> cabal.project
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package text-show" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project ; fi
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "package text-show" >> cabal.project ; fi
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi
if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo "package text-show" >> cabal.project ; fi
if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project ; fi
cat >> cabal.project <<EOF
package text-show
ghc-options: -Werror
EOF
if $HEADHACKAGE; then
echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1,/g')" >> cabal.project
fi
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(text-show)$/; }' >> cabal.project.local
cat cabal.project
cat cabal.project.local
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### next [????.??.??]
* Make the test suite pass with `base-4.22.*` (GHC 9.14).

### 3.11.2 [2025.06.17]
* Support building with the GHC JavaScript backend.

Expand Down
4 changes: 0 additions & 4 deletions src/TextShow/Data/Array.hs
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ import TextShow.Classes (TextShow(..), showbParen, showbSpace)
import TextShow.Data.List ()
import TextShow.Data.Tuple ()

{-# SPECIALIZE
showbIArrayPrec :: (IArray UArray e, Ix i, TextShow i, TextShow e) =>
Int -> UArray i e -> Builder
#-}
-- | Convert an 'IArray' instance to a 'Builder' with the given precedence.
--
-- /Since: 2/
Expand Down
15 changes: 6 additions & 9 deletions src/TextShow/Data/Floating.hs
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,12 @@ showbRealFloatPrec p x
| otherwise = showbGFloat Nothing x
{-# INLINE showbRealFloatPrec #-}

{-# SPECIALIZE showbEFloat ::
Maybe Int -> Float -> Builder,
Maybe Int -> Double -> Builder #-}
{-# SPECIALIZE showbFFloat ::
Maybe Int -> Float -> Builder,
Maybe Int -> Double -> Builder #-}
{-# SPECIALIZE showbGFloat ::
Maybe Int -> Float -> Builder,
Maybe Int -> Double -> Builder #-}
{-# SPECIALIZE showbEFloat :: Maybe Int -> Float -> Builder #-}
{-# SPECIALIZE showbEFloat :: Maybe Int -> Double -> Builder #-}
{-# SPECIALIZE showbFFloat :: Maybe Int -> Float -> Builder #-}
{-# SPECIALIZE showbFFloat :: Maybe Int -> Double -> Builder #-}
{-# SPECIALIZE showbGFloat :: Maybe Int -> Float -> Builder #-}
{-# SPECIALIZE showbGFloat :: Maybe Int -> Double -> Builder #-}

-- | Show a signed 'RealFloat' value
-- using scientific (exponential) notation (e.g. @2.45e2@, @1.5e-3@).
Expand Down
5 changes: 5 additions & 0 deletions src/TextShow/Data/Typeable.hs
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,13 @@ tc'Unlifted = tyConOf (Proxy :: Proxy 'PtrRepUnlifted)
#if MIN_VERSION_base(4,20,0)
isTupleTyCon :: TyCon -> Maybe (Bool, Int)
isTupleTyCon tc
# if MIN_VERSION_base(4,22,0)
| tyConPackage tc == "ghc-internal"
, tyConModule tc == "GHC.Internal.Tuple" || tyConModule tc == "GHC.Internal.Types"
# else
| tyConPackage tc == "ghc-prim"
, tyConModule tc == "GHC.Tuple" || tyConModule tc == "GHC.Types"
# endif
= case tyConName tc of
"Unit" -> Just (True, 0)
"Unit#" -> Just (False, 0)
Expand Down
19 changes: 8 additions & 11 deletions text-show.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ tested-with: GHC == 8.0.2
, GHC == 9.4.8
, GHC == 9.6.7
, GHC == 9.8.4
, GHC == 9.10.2
, GHC == 9.10.3
, GHC == 9.12.2
, GHC == 9.14.1
extra-source-files: CHANGELOG.md, README.md
cabal-version: >=1.10

Expand Down Expand Up @@ -150,18 +151,16 @@ library
TextShow.TH.Names
TextShow.Utils
build-depends: array >= 0.3 && < 0.6
, base >= 4.9 && < 4.22
, base >= 4.9 && < 4.23
, base-compat-batteries >= 0.11 && < 0.15
, bifunctors >= 5.1 && < 6
, bytestring >= 0.10.8.1 && < 0.13
, containers >= 0.1 && < 0.9
, ghc-boot-th >= 8.0 && < 9.13
, ghc-boot-th >= 8.0 && < 9.15
, ghc-prim
, template-haskell >= 2.11 && < 2.24
, template-haskell >= 2.11 && < 2.25
, text >= 1.1 && < 2.2
, th-abstraction >= 0.5 && < 0.8
, transformers >= 0.5 && < 0.7
, transformers-compat >= 0.5 && < 1

-- integer-gmp is only needed on pre-9.0 versions of GHC, as GHC 9.0+ add
-- enough functionality to base to avoid the use of integer-gmp entirely.
Expand Down Expand Up @@ -302,7 +301,7 @@ test-suite spec

TextShow.TH.Names
build-depends: array >= 0.3 && < 0.6
, base >= 4.9 && < 4.22
, base >= 4.9 && < 4.23
, base-compat-batteries >= 0.11 && < 0.15
, base-orphans >= 0.8.5 && < 0.10
, bytestring >= 0.10.8.1 && < 0.13
Expand All @@ -312,10 +311,9 @@ test-suite spec
, hspec >= 2 && < 3
, QuickCheck >= 2.14.3 && < 2.17
, quickcheck-instances >= 0.3.28 && < 0.4
, template-haskell >= 2.11 && < 2.24
, template-haskell >= 2.11 && < 2.25
, text >= 1.1 && < 2.2
, text-show
, transformers >= 0.5 && < 0.7
, transformers-compat >= 0.5 && < 1
build-tool-depends: hspec-discover:hspec-discover

Expand All @@ -330,10 +328,9 @@ test-suite spec
benchmark bench
type: exitcode-stdio-1.0
main-is: Bench.hs
build-depends: base >= 4.9 && < 4.22
build-depends: base >= 4.9 && < 4.23
, criterion >= 1.1.4 && < 2
, deepseq >= 1.3 && < 2
, ghc-prim
, text-show
, text >= 1.1 && < 2.2

Expand Down