Skip to content

Commit

Permalink
Update doctests for GHC 9.2.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
andrewthad committed Apr 26, 2023
1 parent 3e9a4ae commit ff69b64
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions colonnade/src/Colonnade.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
-- +-------+---------+
Expand Down Expand Up @@ -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 |
Expand Down Expand Up @@ -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 |
Expand Down

0 comments on commit ff69b64

Please sign in to comment.