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:
0d5cf9c
)
Add pprString convenience method.
author
Matthijs Kooijman
<m.kooijman@student.utwente.nl>
Sun, 21 Jun 2009 18:43:46 +0000
(20:43 +0200)
committer
Matthijs Kooijman
<m.kooijman@student.utwente.nl>
Sun, 21 Jun 2009 18:43:46 +0000
(20:43 +0200)
This method can convert any Outputable to a string.
Pretty.hs
patch
|
blob
|
history
diff --git
a/Pretty.hs
b/Pretty.hs
index b2ac91ddb6e3334b4b075df407c96936d8855195..7896372f2d27dd01603664e4602dac15901dce70 100644
(file)
--- a/
Pretty.hs
+++ b/
Pretty.hs
@@
-1,4
+1,4
@@
-module Pretty (prettyShow) where
+module Pretty (prettyShow
, pprString
) where
import qualified Data.Map as Map
@@
-151,3
+151,7
@@
instance (Pretty k, Pretty v) => Pretty (Map.Map k v) where
where
ppentry (k, v) =
pPrint k <> text " : " $$ nest 15 (pPrint v)
+
+-- Convenience method for turning an Outputable into a string
+pprString :: (Outputable x) => x -> String
+pprString = showSDoc . ppr