diff options
author | Neil Mitchell <unknown> | 2008-06-14 10:56:50 +0000 |
---|---|---|
committer | Neil Mitchell <unknown> | 2008-06-14 10:56:50 +0000 |
commit | d77c614e18f5f2865a74f7071a1f8c2d8087f88f (patch) | |
tree | aac29659abdaf1e9940cc30254688fddbb3a04a3 /src | |
parent | 8564df0f351648eb94f1ed616ba65d4900dd8c57 (diff) |
Simplify the newtype/data outputting in Hoogle, as haddock does it automatically
Diffstat (limited to 'src')
-rw-r--r-- | src/Haddock/Backends/Hoogle.hs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/Haddock/Backends/Hoogle.hs b/src/Haddock/Backends/Hoogle.hs index 91f4225d..635cc9bf 100644 --- a/src/Haddock/Backends/Hoogle.hs +++ b/src/Haddock/Backends/Hoogle.hs @@ -86,12 +86,8 @@ ppData :: TyClDecl Name -> [String] ppData x = showData x{tcdCons=[],tcdDerivs=Nothing} : concatMap (ppCtor x . unL) (tcdCons x) where - showData = unwords . f . words . out - - -- note: tcdND always seems to not match NewType (BUG?) - f ("data":xs) | tcdND x == NewType = f ("newtype":xs) - f xs | ["="] `isSuffixOf` xs = init xs - f xs = xs + -- GHC gives out "data Bar =", we want to delete the equals + showData = reverse . dropWhile (`elem` " =") . reverse . out ppCtor :: TyClDecl Name -> ConDecl Name -> [String] |