From: Matthijs Kooijman Date: Mon, 6 Apr 2009 13:49:10 +0000 (+0200) Subject: Make Map.Map an instance of Pretty. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=cbf28d60bcea99c0d2c922097a2a4f8b76700d0a;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git Make Map.Map an instance of Pretty. --- 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)