Let the exec function output something.
[matthijs/master-project/cλash.git] / Pretty.hs
index cb1f9fc7c1256900cb0476f0c993f43c953fdc3d..3c007f9c8931116b3c7d3ecd43e689c86806d3d3 100644 (file)
--- a/Pretty.hs
+++ b/Pretty.hs
@@ -47,7 +47,7 @@ instance Pretty FlatFunction where
     (text "Args: ") $$ nest 10 (pPrint args)
     $+$ (text "Result: ") $$ nest 10 (pPrint res)
     $+$ (text "Defs: ") $$ nest 10 (ppdefs defs)
-    $+$ text "Signals: " $$ nest 10 (printList ppsig sigs)
+    $+$ text "Signals: " $$ nest 10 (ppsigs sigs)
     where
       ppsig (id, info) = pPrint id <> pPrint info
       ppdefs defs = vcat (map pPrint sorted)
@@ -57,6 +57,9 @@ instance Pretty FlatFunction where
           sigDefDst (FApp _ _ dst) = head $ Foldable.toList dst
           sigDefDst (CondDef _ _ _ dst) = dst
           sigDefDst (UncondDef _ dst) = dst
+      ppsigs sigs = vcat (map pPrint sorted)
+        where
+          sorted = List.sortBy (\a b -> compare (fst a) (fst b)) sigs
 
 
 instance Pretty SigDef where
@@ -79,7 +82,7 @@ instance Pretty SignalExpr where
     parens $ pPrint a <> text " = " <> pPrint b
 
 instance Pretty SignalInfo where
-  pPrint (SignalInfo name use ty) =
+  pPrint (SignalInfo name use ty hints) =
     text ":" <> (pPrint use) <> (ppname name)
     where
       ppname Nothing = empty