-module Pretty (prettyShow) where
+module Pretty (prettyShow, pprString) where
import qualified Data.Map as Map
instance Pretty SignalExpr where
pPrint (EqLit id lit) =
parens $ pPrint id <> text " = " <> text lit
- pPrint (Literal lit) =
- text lit
+ pPrint (Literal lit ty) =
+ text "(" <> text (show ty) <> text ") " <> text lit
pPrint (Eq a b) =
parens $ pPrint a <> text " = " <> pPrint b
pPrint (CoreSyn.Rec binds) =
text "Rec: " $$ nest 10 (vcat $ map (prettyBind) binds)
+instance (OutputableBndr b, Show b) => Pretty (CoreSyn.Expr b) where
+ pPrint = text . show
+
instance Pretty AST.VHDLId where
pPrint id = ForSyDe.Backend.Ppr.ppr id
where
ppentry (k, v) =
pPrint k <> text " : " $$ nest 15 (pPrint v)
+
+-- Convenience method for turning an Outputable into a string
+pprString :: (Outputable x) => x -> String
+pprString = showSDoc . ppr