projects
/
matthijs
/
master-project
/
cλash.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
95cb86c
)
Make Map.Map an instance of Pretty.
author
Matthijs Kooijman
<m.kooijman@student.utwente.nl>
Mon, 6 Apr 2009 13:49:10 +0000
(15:49 +0200)
committer
Matthijs Kooijman
<m.kooijman@student.utwente.nl>
Mon, 6 Apr 2009 13:49:10 +0000
(15:49 +0200)
Pretty.hs
patch
|
blob
|
history
diff --git
a/Pretty.hs
b/Pretty.hs
index 43e0e49bf7aa6c2dc3ce6822bf47306d57136175..ef92c4dc955aeffe47dfb0877ad1b08f80abbae3 100644
(file)
--- 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)