From cbf28d60bcea99c0d2c922097a2a4f8b76700d0a Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Mon, 6 Apr 2009 15:49:10 +0200 Subject: [PATCH] Make Map.Map an instance of Pretty. --- Pretty.hs | 7 +++++++ 1 file changed, 7 insertions(+) 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) -- 2.30.2