Allow a FlatFunction to be named as well as unnamed.
[matthijs/master-project/cλash.git] / Pretty.hs
index 74ffec79cc52f268ef6217b3a66d5e05f2c944b9..3c6e9fcf5225025fd16a4d8ea00a9d4d73aac33f 100644 (file)
--- a/Pretty.hs
+++ b/Pretty.hs
@@ -45,6 +45,9 @@ instance Pretty id => Pretty (CondDef id) where
 instance Pretty id => Pretty (Signal id) where
   pPrint (Signal id) = pPrint id
 
+instance Pretty NamedSignal where
+  pPrint (NamedSignal name) = pPrint name
+
 instance Pretty VHDLSession where
   pPrint (VHDLSession mod nameCount funcs) =
     text "Module: " $$ nest 15 (text modname)
@@ -52,7 +55,10 @@ 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 (Left f)) = pPrint f
+      ppffunc (Just (Right f)) = pPrint f
+      ppffunc Nothing = text "Nothing"
       modname = showSDoc $ Module.pprModule (HscTypes.cm_module mod)
 
 instance (OutputableBndr b) => Pretty (CoreSyn.Bind b) where