aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock
diff options
context:
space:
mode:
Diffstat (limited to 'src/Haddock')
-rw-r--r--src/Haddock/GHC/Utils.hs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Haddock/GHC/Utils.hs b/src/Haddock/GHC/Utils.hs
index 08eb4fb5..cfe0a83b 100644
--- a/src/Haddock/GHC/Utils.hs
+++ b/src/Haddock/GHC/Utils.hs
@@ -10,6 +10,7 @@ module Haddock.GHC.Utils where
import Debug.Trace
import Data.Char
+import qualified Data.Map as Map
import GHC
import HsSyn
@@ -50,6 +51,13 @@ mkModuleNoPkg str = mkModule (stringToPackageId "") (mkModuleName str)
modulePkgStr = packageIdString . modulePackageId
+-- Instances
+
+
+instance (Outputable a, Outputable b) => Outputable (Map.Map a b) where
+ ppr m = ppr (Map.toList m)
+
+
-- misc
@@ -74,5 +82,8 @@ getMainDeclBinder _ = Nothing
--modInfoName = moduleName . mi_module . minf_iface
--modInfoMod = mi_module . minf_iface
+pretty :: Outputable a => a -> String
+pretty x = show (ppr x defaultUserStyle)
+
trace_ppr x y = trace (showSDoc (ppr x)) y