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
2 changes: 1 addition & 1 deletion .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ jobs:
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"
if [ $((HCNUMVER >= 80000 && HCNUMVER < 90200)) -ne 0 ] ; then echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV" ; else echo "ARG_TESTS=--disable-tests" >> "$GITHUB_ENV" ; fi
if [ $((HCNUMVER >= 70800 && HCNUMVER < 90200)) -ne 0 ] ; then echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV" ; else echo "ARG_BENCH=--disable-benchmarks" >> "$GITHUB_ENV" ; fi
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/no-text.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ jobs:
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
key: ${{ runner.os }}-${{ matrix.ghc }}
- name: Build
run: cabal build -f-text prettyprinter:prettyprinter
# There are linking error when building hashable, see #212.
run: cabal build -f-text --constraint 'semigroups -hashable' prettyprinter:prettyprinter
6 changes: 0 additions & 6 deletions cabal.haskell-ci
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@
-- build only master branch, or PRs to master branch
branches: master

-- gauge works only with newer GHC

-- FIXME: Enable benchmarks for GHC 9.2 once basement (via gauge) is compatible:
-- https://github.com/haskell-foundation/foundation/issues/554
benchmarks: >=7.8.4 && <9.2

-- Doctests fail with GHC 7.10

-- FIXME: Enable tests for GHC 9.2 once doctest is compatible:
Expand Down
5 changes: 2 additions & 3 deletions prettyprinter-ansi-terminal/bench/LargeOutput.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}

{-# OPTIONS_GHC -fno-warn-orphans #-}
Expand All @@ -19,14 +18,14 @@ import Data.Text (Text)
import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Text.Lazy as TL
import Gauge
import GHC.Generics
import Prettyprinter
import Prettyprinter.Render.Terminal as Terminal
import qualified Prettyprinter.Render.Text as Text
import Test.QuickCheck
import Test.QuickCheck.Gen
import Test.QuickCheck.Random
import Test.Tasty.Bench



Expand Down Expand Up @@ -103,7 +102,7 @@ prettyLambdaForm (LambdaForm free bound body) = prettyExp . (<+> anCol Blue "->"
prettyExp = (<+> prettyExpr body)

prettyExpr :: Expr -> Doc AnsiStyle
prettyExpr = \case
prettyExpr = \expr -> case expr of
Let binds body ->
align (vsep [ anCol Red "let" <+> align (prettyBinds binds)
, anCol Red "in" <+> prettyExpr body ])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ benchmark large-output
, base-compat >=0.9.3 && <0.12
, containers
, deepseq
, gauge >= 0.2
, tasty-bench >= 0.2
, prettyprinter
, prettyprinter-ansi-terminal
, QuickCheck >= 2.7
Expand All @@ -75,3 +75,7 @@ benchmark large-output
ghc-options: -O2 -rtsopts -Wall
default-language: Haskell2010
type: exitcode-stdio-1.0

-- For GHC.Generics
if !impl(ghc >= 7.6)
build-depends: ghc-prim
Comment thread
sjakobi marked this conversation as resolved.
2 changes: 1 addition & 1 deletion prettyprinter/bench/FasterUnsafeText.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ module Main (main) where



import Gauge.Main
import Data.Char
import Data.Text (Text)
import qualified Data.Text as T
import Prettyprinter.Internal
import Test.Tasty.Bench



Expand Down
2 changes: 1 addition & 1 deletion prettyprinter/bench/Fusion.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ module Main (main) where

import Control.Monad
import Control.Monad.State
import Gauge.Main
import Data.Text (Text)
import qualified Data.Text as T
import System.Random
import Test.Tasty.Bench

import Prettyprinter
import Prettyprinter.Render.Text
Expand Down
2 changes: 1 addition & 1 deletion prettyprinter/bench/LargeOutput.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import Prelude.Compat

import Control.DeepSeq
import Control.Monad.Compat
import Gauge
import Data.Char
import Data.Map (Map)
import qualified Data.Map as M
Expand All @@ -24,6 +23,7 @@ import GHC.Generics
import Test.QuickCheck
import Test.QuickCheck.Gen
import Test.QuickCheck.Random
import Test.Tasty.Bench
import qualified Text.PrettyPrint.ANSI.Leijen as WL


Expand Down
7 changes: 4 additions & 3 deletions prettyprinter/prettyprinter.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ benchmark fusion
base >= 4.5 && < 5
, prettyprinter

, gauge >= 0.2
, tasty-bench >= 0.2
, mtl >= 2.1
, random >= 1.0
, text
Expand All @@ -195,7 +195,7 @@ benchmark faster-unsafe-text
base >= 4.5 && < 5
, prettyprinter

, gauge >= 0.2
, tasty-bench >= 0.2
, text

hs-source-dirs: bench
Expand All @@ -214,7 +214,7 @@ benchmark large-output
, prettyprinter
, ansi-wl-pprint

, gauge >= 0.2
, tasty-bench >= 0.2
, QuickCheck >= 2.7
, containers
, text
Expand All @@ -226,6 +226,7 @@ benchmark large-output
default-language: Haskell2010
type: exitcode-stdio-1.0

-- For GHC.Generics
if !impl(ghc >= 7.6)
build-depends: ghc-prim

Expand Down