X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=Pretty.hs;h=0cc2b59d98ab4f2ab36ae49aa5e812afdc4b3a60;hb=6808406c77307ba110ec5fc7e03fa7359fdf4646;hp=43e0e49bf7aa6c2dc3ce6822bf47306d57136175;hpb=d8c4021114afc1f860763b3a8dceff3f219d4798;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git diff --git a/Pretty.hs b/Pretty.hs index 43e0e49..0cc2b59 100644 --- a/Pretty.hs +++ b/Pretty.hs @@ -76,8 +76,8 @@ instance Pretty SigDef where 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 @@ -141,3 +141,10 @@ prettyBind (b, expr) = where b' = show b expr' = show expr + +instance (Pretty k, Pretty v) => Pretty (Map.Map k v) where + pPrint = + vcat . map ppentry . Map.toList + where + ppentry (k, v) = + pPrint k <> text " : " $$ nest 15 (pPrint v)