Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Commit a15e7ab

Browse files
committed
Make haddock more robust to changes to the Language data type
With the introduction of GHC2021, the `Languages` data type in GHC will grow. In preparation of that (and to avoid changing haddock with each new language), this change makes the code handle extensions to that data type gracefully. (cherry picked from commit c341dd7)
1 parent 18b91ea commit a15e7ab

File tree

1 file changed

+1
-4
lines changed
  • haddock-api/src/Haddock/Backends

1 file changed

+1
-4
lines changed

haddock-api/src/Haddock/Backends/Xhtml.hs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,7 @@ moduleInfo iface =
223223
("Language", lg)
224224
] ++ extsForm
225225
where
226-
lg inf = case hmi_language inf of
227-
Nothing -> Nothing
228-
Just Haskell98 -> Just "Haskell98"
229-
Just Haskell2010 -> Just "Haskell2010"
226+
lg inf = fmap show (hmi_language inf)
230227

231228
multilineRow :: String -> [String] -> HtmlTable
232229
multilineRow title xs = (th ! [valign "top"]) << title <-> td << (toLines xs)

0 commit comments

Comments
 (0)