diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2018-05-16 09:21:43 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-16 09:21:43 -0400 |
commit | 03c1c10f13577b45027d3456c24fc5c88323ee42 (patch) | |
tree | c90acf38debae0c15f9033ce5eee76b1dbcdf310 /haddock-api | |
parent | a8840a37976209c5a3c4cf929eff502cdca80ecf (diff) | |
parent | 72ff1ba81d29613c8336a7a88c3a01ae540d81d0 (diff) |
Merge pull request #826 from haskell/T825
Remove Hoogle backend hack that butchers infix datatype names
Diffstat (limited to 'haddock-api')
-rw-r--r-- | haddock-api/src/Haddock/Backends/Hoogle.hs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/haddock-api/src/Haddock/Backends/Hoogle.hs b/haddock-api/src/Haddock/Backends/Hoogle.hs index e7ce9d30..59a4f53c 100644 --- a/haddock-api/src/Haddock/Backends/Hoogle.hs +++ b/haddock-api/src/Haddock/Backends/Hoogle.hs @@ -223,13 +223,12 @@ ppData dflags decl@(DataDecl { tcdDataDefn = defn }) subdocs concatMap (ppCtor dflags decl subdocs . unL) (dd_cons defn) where - -- GHC gives out "data Bar =", we want to delete the equals - -- also writes data : a b, when we want data (:) a b - showData d = unwords $ map f $ if last xs == "=" then init xs else xs + -- GHC gives out "data Bar =", we want to delete the equals. + -- There's no need to worry about parenthesizing infix data type names, + -- since this Outputable instance for TyClDecl gets this right already. + showData d = unwords $ if last xs == "=" then init xs else xs where xs = words $ out dflags d - nam = out dflags $ tyClDeclLName d - f w = if w == nam then operator nam else w ppData _ _ _ = panic "ppData" -- | for constructors, and named-fields... |