diff options
author | Neil Mitchell <unknown> | 2008-07-10 16:01:25 +0000 |
---|---|---|
committer | Neil Mitchell <unknown> | 2008-07-10 16:01:25 +0000 |
commit | fe5b0fda74ecac99a003c1ae9df438644f9580e2 (patch) | |
tree | a67df7fc129b922a40f137c08201f5c4fd030afa /src | |
parent | f55439cfcdef0f65b0be79f9efa17bf3fba5be9a (diff) |
Print type signatures with brackets around the name
Diffstat (limited to 'src')
-rw-r--r-- | src/Haddock/Backends/Hoogle.hs | 12 |
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=[]} : |