From 19205c89ea272faf3db38f9d3e219342db260efb Mon Sep 17 00:00:00 2001 From: Ɓukasz Hanuszczak Date: Fri, 7 Aug 2015 17:06:58 +0200 Subject: Add fixity declarations in Hoogle backend output. --- haddock-api/src/Haddock/Backends/Hoogle.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'haddock-api/src/Haddock') diff --git a/haddock-api/src/Haddock/Backends/Hoogle.hs b/haddock-api/src/Haddock/Backends/Hoogle.hs index f174ebcf..04f266af 100644 --- a/haddock-api/src/Haddock/Backends/Hoogle.hs +++ b/haddock-api/src/Haddock/Backends/Hoogle.hs @@ -28,6 +28,7 @@ import Outputable import Data.Char import Data.List import Data.Maybe +import qualified Data.Map as Map import Data.Version import System.FilePath import System.IO @@ -57,7 +58,8 @@ ppModule dflags iface = "" : ppDocumentation dflags (ifaceDoc iface) ++ ["module " ++ moduleString (ifaceMod iface)] ++ concatMap (ppExport dflags) (ifaceExportItems iface) ++ - concatMap (ppInstance dflags) (ifaceInstances iface) + concatMap (ppInstance dflags) (ifaceInstances iface) ++ + concatMap (ppFixity dflags) (Map.toList $ ifaceFixMap iface) --------------------------------------------------------------------- @@ -234,6 +236,10 @@ ppCtor dflags dat subdocs con ResTyGADT _ x -> x +ppFixity :: DynFlags -> (Name, Fixity) -> [String] +ppFixity dflags (name, fixity) = [out dflags (FixitySig [noLoc name] fixity)] + + --------------------------------------------------------------------- -- DOCUMENTATION -- cgit v1.2.3