From ff69b64a1a6165dcf4a0a1c6c371d1b4d4c9c5cb Mon Sep 17 00:00:00 2001 From: Andrew Martin Date: Wed, 26 Apr 2023 09:23:15 -0400 Subject: [PATCH] Update doctests for GHC 9.2. New versions of GHC have become smarter about preserving type synonyms in type signatures displayed to the user. In colonnade, there are several instances where GHC used to report [Char], and it now reports String. The doctests have been updated to pass on newer versions of GHC. They will now fail on older versions of GHC though. --- colonnade/src/Colonnade.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/colonnade/src/Colonnade.hs b/colonnade/src/Colonnade.hs index 708a1a3..bc54acb 100644 --- a/colonnade/src/Colonnade.hs +++ b/colonnade/src/Colonnade.hs @@ -95,7 +95,7 @@ import qualified Data.Vector as Vector -- >>> let showDollar = (('$':) . show) :: Int -> String -- >>> colHouse = mconcat [headed "Color" (show . color), headed "Price" (showDollar . price)] -- >>> :t colHouse --- colHouse :: Colonnade Headed House [Char] +-- colHouse :: Colonnade Headed House String -- >>> let houses = [House Green 170000, House Blue 115000, House Green 150000] -- >>> putStr (ascii colHouse houses) -- +-------+---------+ @@ -179,10 +179,10 @@ fromMaybe c (E.Colonnade v) = E.Colonnade $ flip Vector.map v $ -- >>> let allColors = [Red,Green,Blue] -- >>> let encColor = columns (\c1 c2 -> if c1 == c2 then "✓" else "") (Headed . show) allColors -- >>> :t encColor --- encColor :: Colonnade Headed Color [Char] +-- encColor :: Colonnade Headed Color String -- >>> let encHouse = headed "Price" (showDollar . price) <> lmap color encColor -- >>> :t encHouse --- encHouse :: Colonnade Headed House [Char] +-- encHouse :: Colonnade Headed House String -- >>> putStr (ascii encHouse houses) -- +---------+-----+-------+------+ -- | Price | Red | Green | Blue | @@ -274,7 +274,7 @@ replaceWhen = modifyWhen . const -- -- >>> let cor = mconcat [cap "Person" colPersonFst, cap "House" colHouseSnd] -- >>> :t cor --- cor :: Cornice Headed ('Cap 'Base) (Person, House) [Char] +-- cor :: Cornice Headed ('Cap 'Base) (Person, House) String -- >>> putStr (asciiCapped cor personHomePairs) -- +-------------+-----------------+ -- | Person | House |