From cdae236f0ab7015f3a466b2c9b2449ba038b45f6 Mon Sep 17 00:00:00 2001 From: Sylvain Henry Date: Fri, 26 Jun 2020 16:48:44 +0200 Subject: Fix after Outputable refactoring --- haddock-api/src/Haddock/Backends/Hoogle.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'haddock-api/src/Haddock/Backends/Hoogle.hs') diff --git a/haddock-api/src/Haddock/Backends/Hoogle.hs b/haddock-api/src/Haddock/Backends/Hoogle.hs index d280ed23..8d56a1ed 100644 --- a/haddock-api/src/Haddock/Backends/Hoogle.hs +++ b/haddock-api/src/Haddock/Backends/Hoogle.hs @@ -26,7 +26,9 @@ import Haddock.Types hiding (Version) import Haddock.Utils hiding (out) import GHC +import GHC.Driver.Ppr import GHC.Utils.Outputable as Outputable +import GHC.Utils.Panic import Data.Char import Data.List @@ -106,14 +108,14 @@ outWith p = f . unwords . map (dropWhile isSpace) . lines . p . ppr f [] = [] out :: Outputable a => DynFlags -> a -> String -out dflags = outWith $ showSDocUnqual dflags +out dflags = outWith $ showSDoc dflags operator :: String -> String operator (x:xs) | not (isAlphaNum x) && x `notElem` "_' ([{" = '(' : x:xs ++ ")" operator x = x commaSeparate :: Outputable a => DynFlags -> [a] -> String -commaSeparate dflags = showSDocUnqual dflags . interpp'SP +commaSeparate dflags = showSDoc dflags . interpp'SP --------------------------------------------------------------------- -- How to print each export @@ -173,7 +175,7 @@ ppClass dflags decl subdocs = ppTyFams | null $ tcdATs decl = "" - | otherwise = (" " ++) . showSDocUnqual dflags . whereWrapper $ concat + | otherwise = (" " ++) . showSDoc dflags . whereWrapper $ concat [ map pprTyFam (tcdATs decl) , map (pprTyFamInstDecl NotTopLevel . unLoc) (tcdATDefs decl) ] -- cgit v1.2.3