From fe5b0fda74ecac99a003c1ae9df438644f9580e2 Mon Sep 17 00:00:00 2001 From: Neil Mitchell Date: Thu, 10 Jul 2008 16:01:25 +0000 Subject: Print type signatures with brackets around the name --- src/Haddock/Backends/Hoogle.hs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/Haddock/Backends') 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=[]} : -- cgit v1.2.3