aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/Backends/Xhtml/Utils.hs
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2017-03-10 10:21:55 -0500
committerBen Gamari <ben@smart-cactus.org>2017-03-10 10:21:55 -0500
commitdb13d5f56d8e693b44bafc793d7b3bfac1c25b91 (patch)
tree128f2c23169c06c7a645979e37a1ba2cfda82c4b /haddock-api/src/Haddock/Backends/Xhtml/Utils.hs
parent240bc38b94ed2d0af27333b23392d03eeb615e82 (diff)
parentd2be5e88281d8e3148bc55830c27c75844b86f38 (diff)
Merge branch 'ghc-head'
Diffstat (limited to 'haddock-api/src/Haddock/Backends/Xhtml/Utils.hs')
-rw-r--r--haddock-api/src/Haddock/Backends/Xhtml/Utils.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Utils.hs b/haddock-api/src/Haddock/Backends/Xhtml/Utils.hs
index 1d49807d..a8b4a4ec 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml/Utils.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml/Utils.hs
@@ -20,7 +20,7 @@ module Haddock.Backends.Xhtml.Utils (
(<+>), (<=>), char,
keyword, punctuate,
- braces, brackets, pabrackets, parens, parenList, ubxParenList,
+ braces, brackets, pabrackets, parens, parenList, ubxParenList, ubxSumList,
arrow, comma, dcolon, dot, darrow, equals, forallSymbol, quote, promoQuote,
hsep, vcat,
@@ -75,8 +75,7 @@ spliceURL' maybe_file maybe_mod maybe_name maybe_loc = run
case span_ of
RealSrcSpan span__ ->
show $ srcSpanStartLine span__
- UnhelpfulSpan _ ->
- error "spliceURL UnhelpfulSpan"
+ UnhelpfulSpan _ -> ""
run "" = ""
run ('%':'M':rest) = mdl ++ run rest
@@ -178,6 +177,10 @@ ubxParenList :: [Html] -> Html
ubxParenList = ubxparens . hsep . punctuate comma
+ubxSumList :: [Html] -> Html
+ubxSumList = ubxparens . hsep . punctuate (toHtml " | ")
+
+
ubxparens :: Html -> Html
ubxparens h = toHtml "(#" +++ h +++ toHtml "#)"