X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Futils%2FUniqFM.lhs;h=fbea784cad20178b1e1818b25a4685d9fd241d29;hb=1f3a9da2d3b6dcaf0634b3d4f5dbe54f069eebb8;hp=868d20ac26e36863ffd26bacaadbd18a77a7c7d2;hpb=451a8613203721d344e26eb043e8af827c58cd7b;p=ghc-hetmet.git diff --git a/ghc/compiler/utils/UniqFM.lhs b/ghc/compiler/utils/UniqFM.lhs index 868d20a..fbea784 100644 --- a/ghc/compiler/utils/UniqFM.lhs +++ b/ghc/compiler/utils/UniqFM.lhs @@ -51,6 +51,7 @@ import {-# SOURCE #-} Name ( Name ) import Unique ( Uniquable(..), Unique, u2i, mkUniqueGrimily ) import Panic import GlaExts -- Lots of Int# operations +import Outputable #if ! OMIT_NATIVE_CODEGEN #define IF_NCG(a) a @@ -198,18 +199,19 @@ data UniqFM ele (UniqFM ele) (UniqFM ele) --- for debugging only :-) {- -instance Text (UniqFM a) where - showsPrec _ (NodeUFM a b t1 t2) = - showString "NodeUFM " . shows (IBOX(a)) - . showString " " . shows (IBOX(b)) - . showString " (" . shows t1 - . showString ") (" . shows t2 - . showString ")" - showsPrec _ (LeafUFM x a) = showString "LeafUFM " . shows (IBOX(x)) - showsPrec _ (EmptyUFM) = id +-- for debugging only :-) +instance Outputable (UniqFM a) where + ppr(NodeUFM a b t1 t2) = + sep [text "NodeUFM " <+> int IBOX(a) <+> int IBOX(b), + nest 1 (parens (ppr t1)), + nest 1 (parens (ppr t2))] + ppr (LeafUFM x a) = text "LeafUFM " <+> int IBOX(x) + ppr (EmptyUFM) = empty -} +-- and when not debugging the package itself... +instance Outputable a => Outputable (UniqFM a) where + ppr ufm = ppr (ufmToList ufm) \end{code} %************************************************************************