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
16 changes: 11 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,17 @@ jobs:
- run: cabal build --dependencies-only
- run: cabal build

# Cannot build the testsuite because template-haskell depends on pretty
# and containers and QuickCheck depend on template-haskell.
# See also https://github.com/haskell/containers/issues/1156
# - run: cabal build -c 'QuickCheck -templatehaskell' --enable-tests
# - run: cabal test -c 'QuickCheck -templatehaskell' --enable-tests
- name: Tests (not possible for GHC 9.8 and up)
if: matrix.ghc == '9.6'
run: |
cabal build -c 'QuickCheck -templatehaskell' --enable-tests
cabal test -c 'QuickCheck -templatehaskell' --enable-tests
# Since 9.8, containers depends on template-haskell which depends on pretty.
# This cycle cannot be solved by cabal.
# See https://github.com/haskell/containers/issues/1156

# Cannot build the benchmarks because they depend on template-haskell
# which depends on pretty.
# - run: cabal build -c 'QuickCheck -templatehaskell' --enable-tests --enable-benchmarks
# - run: cabal bench -c 'QuickCheck -templatehaskell' --enable-tests --enable-benchmarks

Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ jobs:
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
echo "ARG_TESTS=--disable-tests" >> "$GITHUB_ENV"
if [ $((HCNUMVER >= 90000 && HCNUMVER < 90400)) -ne 0 ] ; then echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV" ; else echo "ARG_TESTS=--disable-tests" >> "$GITHUB_ENV" ; fi
echo "ARG_BENCH=--disable-benchmarks" >> "$GITHUB_ENV"
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
Expand Down Expand Up @@ -239,6 +239,9 @@ jobs:
- name: build
run: |
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always
- name: tests
run: |
if [ $((HCNUMVER >= 90000 && HCNUMVER < 90400)) -ne 0 ] ; then $CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct ; fi
- name: cabal check
run: |
cd ${PKGDIR_pretty} || false
Expand Down
10 changes: 6 additions & 4 deletions bench/Bench.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@
{-# LANGUAGE PackageImports #-}
module Main where

import Criterion.Main
import Data.List
import Prelude hiding ( (<>) )

import Criterion.Main ( bench, bgroup, defaultMain, nf)
import qualified Data.List as List
import Text.PrettyPrint.HughesPJ

--------------------------------------------------------------------------------
f_left :: Int -> Doc
f_left n = foldl' (<>) empty (map (text . show) [10001..10000+n])
f_left n = List.foldl' (<>) empty (map (text . show) [10001..10000+n])

--------------------------------------------------------------------------------
f_right :: Int -> Doc
f_right n = foldr (<>) empty (map (text . show) [10001..10000+n])
f_right n = List.foldr (<>) empty (map (text . show) [10001..10000+n])

--------------------------------------------------------------------------------
stuff :: String -> String -> Double -> Rational -> Int -> Int -> Int -> Doc
Expand Down
10 changes: 9 additions & 1 deletion cabal.haskell-ci
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,13 @@ branches: master
installed: +all -pretty
-- Tests and benchmarks do not build due to cycling package dependencies.
-- QuickCheck/containers -> template-haskell -> pretty.
-- Building the benchmarks requires template-haskell which depends on pretty
-- causing a dependency cycle that cabal cannot handle.
benchmarks: False
tests: False

-- Testsuite broken with GHC 8 because it does some hack
-- dropping the module header when building the testsuite
-- which leads to misplaced LANGUAGE pragmas.
-- Testsuite broken with GHC >= 9.4 due to cycle involving
-- QuickCheck, containers, template-haskell and pretty.
tests: >=9.0 && <9.4
4 changes: 2 additions & 2 deletions src/Text/PrettyPrint.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
-- Module : Text.PrettyPrint
-- Copyright : (c) The University of Glasgow 2001
-- License : BSD-style (see the file LICENSE)
--
--
-- Maintainer : David Terei <code@davidterei.com>
-- Stability : stable
-- Portability : portable
Expand All @@ -21,7 +21,7 @@
--
-----------------------------------------------------------------------------

module Text.PrettyPrint (
module Text.PrettyPrint (

-- * The document type
Doc,
Expand Down
4 changes: 2 additions & 2 deletions src/Text/PrettyPrint/Annotated.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
-- Module : Text.PrettyPrint.Annotated
-- Copyright : (c) Trevor Elliott <revor@galois.com> 2015
-- License : BSD-style (see the file LICENSE)
--
--
-- Maintainer : David Terei <code@davidterei.com>
-- Stability : stable
-- Portability : portable
Expand All @@ -21,7 +21,7 @@
--
-----------------------------------------------------------------------------

module Text.PrettyPrint.Annotated (
module Text.PrettyPrint.Annotated (

-- * The document type
Doc,
Expand Down
2 changes: 1 addition & 1 deletion src/Text/PrettyPrint/HughesPJClass.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
-- Stability : stable
-- Portability : portable
--
-- Pretty printing class, simlar to 'Show' but nicer looking.
-- Pretty printing class, simlar to 'Show' but nicer looking.
--
-- Note that the precedence level is a 'Rational' so there is an unlimited
-- number of levels. This module re-exports 'Text.PrettyPrint.HughesPJ'.
Expand Down
2 changes: 1 addition & 1 deletion tests/BugSep.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ main :: IO ()
main = do
putStrLn ""
putStrLn "Note that the correct definition of sep is currently unclear"
putStrLn "It is neither foldr ($+$) empty nor foldr ($$) empty"
putStrLn "It is neither foldr ($+$) empty nor foldr ($$) empty"
putStrLn "------------------------------------------------------------"
let test1 = [ text "" $+$ text "c", nest 3 ( text "a") ]
let test2 = [ text "c", nest 3 ( text "b") ]
Expand Down
Loading
Loading