From ac04da29b1a2bfb7139b7e9d0d2b88ea397a3bcc Mon Sep 17 00:00:00 2001 From: Mateusz Kowalczyk Date: Tue, 27 Aug 2013 06:59:12 +0100 Subject: 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. --- src/Haddock/Backends/LaTeX.hs | 8 ++++++-- 1 file 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" ------------------------------------------------------------------------------- -- cgit v1.2.3