aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock
diff options
context:
space:
mode:
authorMateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>2013-08-27 06:59:12 +0100
committerMateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>2013-08-27 06:59:12 +0100
commitac04da29b1a2bfb7139b7e9d0d2b88ea397a3bcc (patch)
tree607a4b495f7c6801c8b724a6214af818e9850b2e /src/Haddock
parentc298f6041c1dabff3d049b9fe7610b71fb3ff396 (diff)
Fix ticket #247.
I do the same thing that the XHTML backend does: give these no special treatment and just act as if they are regular functions.
Diffstat (limited to 'src/Haddock')
-rw-r--r--src/Haddock/Backends/LaTeX.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Haddock/Backends/LaTeX.hs b/src/Haddock/Backends/LaTeX.hs
index b8635d03..4f947249 100644
--- a/src/Haddock/Backends/LaTeX.hs
+++ b/src/Haddock/Backends/LaTeX.hs
@@ -245,6 +245,8 @@ declNames :: LHsDecl DocName -> [DocName]
declNames (L _ decl) = case decl of
TyClD d -> [tcdName d]
SigD (TypeSig lnames _) -> map unLoc lnames
+ ForD (ForeignImport (L _ n) _ _ _) -> [n]
+ ForD (ForeignExport (L _ n) _ _ _) -> [n]
_ -> error "declaration not supported by declNames"
@@ -299,8 +301,10 @@ ppTyFam _ _ _ _ _ =
ppFor :: SrcSpan -> DocForDecl DocName -> ForeignDecl DocName -> Bool -> LaTeX
-ppFor _ _ _ _ =
- error "foreign declarations are currently not supported by --latex"
+ppFor loc doc (ForeignImport (L _ name) (L _ typ) _ _) unicode =
+ ppFunSig loc doc [name] typ unicode
+ppFor _ _ _ _ = error "ppFor error in Haddock.Backends.LaTeX"
+-- error "foreign declarations are currently not supported by --latex"
-------------------------------------------------------------------------------