--- pretty-1.0.1.0/Text/PrettyPrint/HughesPJ.hs	2008-11-16 14:12:16.000000000 -0800
+++ pretty-1.0.1.0-new/Text/PrettyPrint/HughesPJ.hs	2009-03-02 01:25:53.000000000 -0800
@@ -175,7 +175,7 @@
 	-- * Constructing documents
 	-- ** Converting values into documents
         char, text, ptext, zeroWidthText,
-        int, integer, float, double, rational,
+        int, integer, float, double, rational, hex,
 
 	-- ** Simple derived documents
         semi, comma, colon, space, equals,
@@ -214,6 +214,7 @@
 
 
 import Prelude
+import Numeric
 
 infixl 6 <> 
 infixl 6 <+>
@@ -482,8 +483,9 @@
 float    n = text (show n)
 double   n = text (show n)
 rational n = text (show n)
--- SIGBJORN wrote instead:
--- rational n = text (show (fromRationalX n))
+hex nr n = text . pad nr . showHex n $ ""
+  where
+  pad n s = let l = length s in if l < n then replicate (n - l) '0' ++ s else drop (l - n) s
 
 quotes p        = char '\'' <> p <> char '\''
 doubleQuotes p  = char '"' <> p <> char '"'
