From 0952d94a2e30a3e7cddbede811b15fa70f7b9462 Mon Sep 17 00:00:00 2001 From: Joachim Breitner Date: Tue, 19 Jan 2021 11:39:38 +0100 Subject: 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 c341dd7c9c3fc5ebc83a2d577c5a726f3eb152a5) --- haddock-api/src/Haddock/Backends/Xhtml.hs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'haddock-api/src/Haddock/Backends') diff --git a/haddock-api/src/Haddock/Backends/Xhtml.hs b/haddock-api/src/Haddock/Backends/Xhtml.hs index 24b565fc..3453bb0c 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml.hs @@ -223,10 +223,7 @@ moduleInfo iface = ("Language", lg) ] ++ extsForm where - lg inf = case hmi_language inf of - Nothing -> Nothing - Just Haskell98 -> Just "Haskell98" - Just Haskell2010 -> Just "Haskell2010" + lg inf = fmap show (hmi_language inf) multilineRow :: String -> [String] -> HtmlTable multilineRow title xs = (th ! [valign "top"]) << title <-> td << (toLines xs) -- cgit v1.2.3