[commit: haddock] master, wip/api-annots-ghc-7.10-3: Fix Hoogle display of constructors (bb0ecbb)

git at git.haskell.org git at git.haskell.org
Wed Jul 8 08:37:53 UTC 2015


Repository : ssh://git@git.haskell.org/haddock

On branches: master,wip/api-annots-ghc-7.10-3
Link       : http://git.haskell.org/haddock.git/commitdiff/bb0ecbb4053a593cc8ef80a277c4ef40b13998d5

>---------------------------------------------------------------

commit bb0ecbb4053a593cc8ef80a277c4ef40b13998d5
Author: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk>
Date:   Fri Mar 27 01:14:11 2015 +0000

    Fix Hoogle display of constructors
    
    Fixes #361


>---------------------------------------------------------------

bb0ecbb4053a593cc8ef80a277c4ef40b13998d5
 CHANGES                                    | 2 ++
 haddock-api/src/Haddock/Backends/Hoogle.hs | 5 ++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/CHANGES b/CHANGES
index 419a7be..15ab0a2 100644
--- a/CHANGES
+++ b/CHANGES
@@ -35,6 +35,8 @@ Changes in version 2.16.0
  * Don't default to type constructors for out-of-scope names (#253 and
    #375)
 
+ * Fix Hoogle display of constructors (#361)
+
 Changes in version 2.15.0
 
  * Always read in prologue files as UTF8 (#286 and Cabal #1721)
diff --git a/haddock-api/src/Haddock/Backends/Hoogle.hs b/haddock-api/src/Haddock/Backends/Hoogle.hs
index fe656a4..ef86958 100644
--- a/haddock-api/src/Haddock/Backends/Hoogle.hs
+++ b/haddock-api/src/Haddock/Backends/Hoogle.hs
@@ -198,7 +198,10 @@ ppCtor dflags dat subdocs con
         apps = foldl1 (\x y -> reL $ HsAppTy x y)
 
         typeSig nm flds = operator nm ++ " :: " ++ outHsType dflags (makeExplicit $ unL $ funs flds)
-        name = out dflags $ map unL $ con_names con
+
+        -- We print the constructors as comma-separated list. See GHC
+        -- docs for con_names on why it is a list to begin with.
+        name = showSDocUnqual dflags . interpp'SP . map unL $ con_names con
 
         resType = case con_res con of
             ResTyH98 -> apps $ map (reL . HsTyVar) $



More information about the ghc-commits mailing list