aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/Backends
diff options
context:
space:
mode:
authorJoachim Breitner <mail@joachim-breitner.de>2021-01-19 11:39:38 +0100
committerAlexander Biehl <alexbiehl@gmail.com>2021-01-22 19:03:45 +0100
commit0952d94a2e30a3e7cddbede811b15fa70f7b9462 (patch)
treeae54c3c14cf007df490e3689686afa1dc4d5c624 /haddock-api/src/Haddock/Backends
parent911357bcd3eb2f1f03ba06831e07d45595b3a458 (diff)
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)
Diffstat (limited to 'haddock-api/src/Haddock/Backends')
-rw-r--r--haddock-api/src/Haddock/Backends/Xhtml.hs5
1 files changed, 1 insertions, 4 deletions
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)