From ab24835eadb99059934d7a14f86564eea6449257 Mon Sep 17 00:00:00 2001 From: David Waern Date: Sat, 11 Jun 2011 00:33:33 +0000 Subject: * Merge in git patch from Michal Terepeta From 6fc71d067738ef4b7de159327bb6dc3d0596be29 Mon Sep 17 00:00:00 2001 From: Michal Terepeta Date: Sat, 14 May 2011 19:18:22 +0200 Subject: [PATCH] Follow the change of TypeSig in GHC. This follows the change in GHC to make TypeSig take a list of names (instead of just one); GHC ticket #1595. This should also improve the Haddock output in case the user writes a type signature that refers to many names: -- | Some comment.. foo, bar :: ... will now generate the expected output with one signature for both names. --- src/Haddock/Backends/Hoogle.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/Haddock/Backends/Hoogle.hs') diff --git a/src/Haddock/Backends/Hoogle.hs b/src/Haddock/Backends/Hoogle.hs index e4415db9..44e83d64 100644 --- a/src/Haddock/Backends/Hoogle.hs +++ b/src/Haddock/Backends/Hoogle.hs @@ -114,16 +114,17 @@ ppExport (ExportDecl decl dc subdocs _) = doc (fst dc) ++ f (unL decl) f (TyClD d@TyData{}) = ppData d subdocs f (TyClD d@ClassDecl{}) = ppClass d f (TyClD d@TySynonym{}) = ppSynonym d - f (ForD (ForeignImport name typ _)) = ppSig $ TypeSig name typ - f (ForD (ForeignExport name typ _)) = ppSig $ TypeSig name typ + 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) ++ " :: " ++ outHsType typ] +ppSig (TypeSig names sig) = [operator prettyNames ++ " :: " ++ outHsType typ] where + prettyNames = concat . intersperse ", " $ map out names typ = case unL sig of HsForAllTy Explicit a b c -> HsForAllTy Implicit a b c x -> x -- cgit v1.2.3