Commit ba5a4da6 authored by David Terei's avatar David Terei
Browse files

Merge pull request #35 from ndmitchell/master

Remove harmful $! forcing in beside
parents f904ff76 a5c916ae
......@@ -62,6 +62,7 @@ Test-Suite test-pretty
UnitLargeDoc
UnitPP1
UnitT3911
UnitT32
extensions: CPP, BangPatterns, DeriveGeneric
include-dirs: src/Text/PrettyPrint/Annotated
ghc-options: -rtsopts -with-rtsopts=-K2M
......
......@@ -695,7 +695,7 @@ beside p@(Beside p1 g1 q1) g2 q2
| otherwise = beside (reduceDoc p) g2 q2
beside p@(Above{}) g q = let !d = reduceDoc p in beside d g q
beside (NilAbove p) g q = nilAbove_ $! beside p g q
beside (TextBeside t p) g q = TextBeside t $! rest
beside (TextBeside t p) g q = TextBeside t rest
where
rest = case p of
Empty -> nilBeside g q
......
......@@ -18,6 +18,7 @@ import TestStructures
import UnitLargeDoc
import UnitPP1
import UnitT3911
import UnitT32
import Control.Monad
import Data.Char (isSpace)
......@@ -39,6 +40,7 @@ main = do
-- unit tests
testPP1
testT3911
testT32
testLargeDoc
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
-- Test from https://github.com/haskell/pretty/issues/32#issuecomment-223073337
module UnitT32 where
import Text.PrettyPrint.HughesPJ
import TestUtils
testT32 :: IO ()
testT32 = simpleMatch "T3911" (replicate 10 'x') $ take 10 $ render $ hcat $ repeat $ text "x"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment