summaryrefslogtreecommitdiff
path: root/dev-haskell/haddock-api/files/haddock-api-2.24.0-haddock-library-1.10.patch
diff options
context:
space:
mode:
Diffstat (limited to 'dev-haskell/haddock-api/files/haddock-api-2.24.0-haddock-library-1.10.patch')
-rw-r--r--dev-haskell/haddock-api/files/haddock-api-2.24.0-haddock-library-1.10.patch124
1 files changed, 124 insertions, 0 deletions
diff --git a/dev-haskell/haddock-api/files/haddock-api-2.24.0-haddock-library-1.10.patch b/dev-haskell/haddock-api/files/haddock-api-2.24.0-haddock-library-1.10.patch
new file mode 100644
index 000000000000..1627b73eba9d
--- /dev/null
+++ b/dev-haskell/haddock-api/files/haddock-api-2.24.0-haddock-library-1.10.patch
@@ -0,0 +1,124 @@
+--- a/src/Haddock/Backends/Hoogle.hs
++++ b/src/Haddock/Backends/Hoogle.hs
+@@ -1,3 +1,4 @@
++{-# LANGUAGE CPP #-}
+ {-# LANGUAGE FlexibleContexts #-}
+ {-# LANGUAGE TypeFamilies #-}
+ -----------------------------------------------------------------------------
+@@ -326,7 +327,11 @@ markupTag dflags = Markup {
+ markupAppend = (++),
+ markupIdentifier = box (TagInline "a") . str . out dflags,
+ markupIdentifierUnchecked = box (TagInline "a") . str . showWrapped (out dflags . snd),
++#if MIN_VERSION_haddock_library(1,10,0)
++ markupModule = box (TagInline "a") . str . modLinkName,
++#else
+ markupModule = box (TagInline "a") . str,
++#endif
+ markupWarning = box (TagInline "i"),
+ markupEmphasis = box (TagInline "i"),
+ markupBold = box (TagInline "b"),
+--- a/src/Haddock/Backends/LaTeX.hs
++++ b/src/Haddock/Backends/LaTeX.hs
+@@ -1,3 +1,4 @@
++{-# LANGUAGE CPP #-}
+ {-# OPTIONS_GHC -fno-warn-name-shadowing #-}
+ {-# LANGUAGE RecordWildCards #-}
+ {-# LANGUAGE TypeFamilies #-}
+@@ -1206,7 +1207,11 @@ latexMarkup = Markup
+ , markupAppend = \l r v -> l v . r v
+ , markupIdentifier = \i v -> inlineElem (markupId v (fmap occName i))
+ , markupIdentifierUnchecked = \i v -> inlineElem (markupId v (fmap snd i))
++#if MIN_VERSION_haddock_library(1,10,0)
++ , markupModule = \m _ -> inlineElem (let (mdl,_ref) = break (=='#') (modLinkName m) in (tt (text mdl)))
++#else
+ , markupModule = \m _ -> inlineElem (let (mdl,_ref) = break (=='#') m in (tt (text mdl)))
++#endif
+ , markupWarning = \p v -> p v
+ , markupEmphasis = \p v -> inlineElem (emph (p v empty))
+ , markupBold = \p v -> inlineElem (bold (p v empty))
+--- a/src/Haddock/Backends/Xhtml/DocMarkup.hs
++++ b/src/Haddock/Backends/Xhtml/DocMarkup.hs
+@@ -1,3 +1,4 @@
++{-# LANGUAGE CPP #-}
+ -----------------------------------------------------------------------------
+ -- |
+ -- Module : Haddock.Backends.Html.DocMarkup
+@@ -44,7 +45,11 @@ parHtmlMarkup qual insertAnchors ppId = Markup {
+ markupAppend = (+++),
+ markupIdentifier = thecode . ppId insertAnchors,
+ markupIdentifierUnchecked = thecode . ppUncheckedLink qual,
++#if MIN_VERSION_haddock_library(1,10,0)
++ markupModule = \m -> let (mdl,ref) = break (=='#') (modLinkName m)
++#else
+ markupModule = \m -> let (mdl,ref) = break (=='#') m
++#endif
+ -- Accomodate for old style
+ -- foo\#bar anchors
+ mdl' = case reverse mdl of
+--- a/src/Haddock/Interface/LexParseRn.hs
++++ b/src/Haddock/Interface/LexParseRn.hs
+@@ -1,3 +1,4 @@
++{-# LANGUAGE CPP #-}
+ {-# OPTIONS_GHC -Wwarn #-}
+ {-# LANGUAGE BangPatterns #-}
+ {-# LANGUAGE ViewPatterns #-}
+@@ -148,7 +149,11 @@ rename dflags gre = rn
+ DocDefList list -> DocDefList <$> traverse (\(a, b) -> (,) <$> rn a <*> rn b) list
+ DocCodeBlock doc -> DocCodeBlock <$> rn doc
+ DocIdentifierUnchecked x -> pure (DocIdentifierUnchecked x)
++#if MIN_VERSION_haddock_library(1,10,0)
++ DocModule (ModLink m l) -> DocModule . ModLink m <$> traverse rn l
++#else
+ DocModule str -> pure (DocModule str)
++#endif
+ DocHyperlink (Hyperlink u l) -> DocHyperlink . Hyperlink u <$> traverse rn l
+ DocPic str -> pure (DocPic str)
+ DocMathInline str -> pure (DocMathInline str)
+--- a/src/Haddock/InterfaceFile.hs
++++ b/src/Haddock/InterfaceFile.hs
+@@ -521,9 +521,16 @@ instance (Binary mod, Binary id) => Binary (DocH mod id) where
+ put_ bh (DocIdentifier ae) = do
+ putByte bh 4
+ put_ bh ae
++#if MIN_VERSION_haddock_library(1,10,0)
++ put_ bh (DocModule (ModLink af bf)) = do
++ putByte bh 5
++ put_ bh af
++ put_ bh bf
++#else
+ put_ bh (DocModule af) = do
+ putByte bh 5
+ put_ bh af
++#endif
+ put_ bh (DocEmphasis ag) = do
+ putByte bh 6
+ put_ bh ag
+@@ -598,8 +605,14 @@ instance (Binary mod, Binary id) => Binary (DocH mod id) where
+ ae <- get bh
+ return (DocIdentifier ae)
+ 5 -> do
++#if MIN_VERSION_haddock_library(1,10,0)
++ af <- get bh
++ bf <- get bh
++ return (DocModule (ModLink af bf))
++#else
+ af <- get bh
+ return (DocModule af)
++#endif
+ 6 -> do
+ ag <- get bh
+ return (DocEmphasis ag)
+--- a/src/Haddock/Types.hs
++++ b/src/Haddock/Types.hs
+@@ -466,7 +466,11 @@ instance (NFData a, NFData mod)
+ DocParagraph a -> a `deepseq` ()
+ DocIdentifier a -> a `deepseq` ()
+ DocIdentifierUnchecked a -> a `deepseq` ()
++#if MIN_VERSION_haddock_library(1,10,0)
++ DocModule (ModLink a b) -> a `deepseq` b `deepseq` ()
++#else
+ DocModule a -> a `deepseq` ()
++#endif
+ DocWarning a -> a `deepseq` ()
+ DocEmphasis a -> a `deepseq` ()
+ DocBold a -> a `deepseq` ()