Store signals in a map.
[matthijs/master-project/cλash.git] / Pretty.hs
index 74ffec79cc52f268ef6217b3a66d5e05f2c944b9..d4ed8f01d93da2ddcc46be08d6c5f83eed1db487 100644 (file)
--- a/Pretty.hs
+++ b/Pretty.hs
@@ -42,8 +42,9 @@ instance Pretty id => Pretty (FApp id) where
 instance Pretty id => Pretty (CondDef id) where
   pPrint _ = text "TODO"
 
-instance Pretty id => Pretty (Signal id) where
-  pPrint (Signal id) = pPrint id
+instance Pretty SignalInfo where
+  pPrint (SignalInfo Nothing) = empty
+  pPrint (SignalInfo (Just name)) = text ":" <> text name
 
 instance Pretty VHDLSession where
   pPrint (VHDLSession mod nameCount funcs) =
@@ -52,7 +53,9 @@ instance Pretty VHDLSession where
     $+$ text "Functions: " $$ nest 15 (vcat (map ppfunc (Map.toList funcs)))
     where
       ppfunc (hsfunc, (FuncData flatfunc)) =
-        pPrint hsfunc $+$ (text "Flattened: " $$ nest 15 (pPrint flatfunc))
+        pPrint hsfunc $+$ (text "Flattened: " $$ nest 15 (ppffunc flatfunc))
+      ppffunc (Just f) = pPrint f
+      ppffunc Nothing  = text "Nothing"
       modname = showSDoc $ Module.pprModule (HscTypes.cm_module mod)
 
 instance (OutputableBndr b) => Pretty (CoreSyn.Bind b) where