X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=Pretty.hs;h=ef92c4dc955aeffe47dfb0877ad1b08f80abbae3;hb=7351c9c23660a0217c42483e10ac9b7a25cb49b2;hp=43e0e49bf7aa6c2dc3ce6822bf47306d57136175;hpb=d8c4021114afc1f860763b3a8dceff3f219d4798;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git diff --git a/Pretty.hs b/Pretty.hs index 43e0e49..ef92c4d 100644 --- a/Pretty.hs +++ b/Pretty.hs @@ -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)