instance Pretty HsValueUse where
pPrint Port = char 'P'
- pPrint (State n) = char 'C' <> int n
+ pPrint (State n) = char 'S' <> int n
pPrint (HighOrder _ _) = text "Higher Order"
instance Pretty FlatFunction where
instance Pretty SigDef where
pPrint (FApp func args res) =
pPrint func <> text " : " <> pPrint args <> text " -> " <> pPrint res
- pPrint (CondDef _ _ _ _) = text "TODO"
- pPrint (UncondDef src dst) = text "TODO"
+ pPrint (CondDef cond true false res) =
+ pPrint cond <> text " ? " <> pPrint true <> text " : " <> pPrint false <> text " -> " <> pPrint res
+ pPrint (UncondDef src dst) =
+ ppsrc src <> text " -> " <> pPrint dst
+ where
+ ppsrc (Left id) = pPrint id
+ ppsrc (Right expr) = pPrint expr
+
+instance Pretty SignalExpr where
+ pPrint (EqLit id lit) =
+ parens $ pPrint id <> text " = " <> text lit
+ pPrint (Literal lit) =
+ text lit
+ pPrint (Eq a b) =
+ parens $ pPrint a <> text " = " <> pPrint b
instance Pretty SignalInfo where
pPrint (SignalInfo name use ty) =