aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Haddock/Backends/Hoogle.hs12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/Haddock/Backends/Hoogle.hs b/src/Haddock/Backends/Hoogle.hs
index 33dd5da8..487c347b 100644
--- a/src/Haddock/Backends/Hoogle.hs
+++ b/src/Haddock/Backends/Hoogle.hs
@@ -91,12 +91,18 @@ ppExport (ExportDecl decl dc _) = doc dc ++ f (unL decl)
where
f (TyClD d@TyData{}) = ppData d
f (TyClD d@ClassDecl{}) = ppClass d
- f (ForD (ForeignImport name typ _)) = [out $ SigD $ TypeSig name typ]
- f (ForD (ForeignExport name typ _)) = [out $ SigD $ TypeSig name typ]
- f decl = [out decl]
+ f (ForD (ForeignImport name typ _)) = ppSig $ TypeSig name typ
+ f (ForD (ForeignExport name typ _)) = ppSig $ TypeSig name typ
+ f (SigD sig) = ppSig sig
+ f _ = []
ppExport _ = []
+ppSig :: Sig Name -> [String]
+ppSig (TypeSig name sig) = [operator (out name) ++ " :: " ++ out sig]
+ppSig _ = []
+
+
-- note: does not yet output documentation for class methods
ppClass :: TyClDecl Name -> [String]
ppClass x = out x{tcdSigs=[]} :