Ticket #3058: Add 'hex' to the pretty package (and other thoughts)
Thomas DuBuisson
thomas.dubuisson at gmail.com
Mon Mar 2 04:53:03 EST 2009
All,
http://hackage.haskell.org/trac/ghc/ticket/3058
Attached is a patch for Text.PrettyPrint.HughesPJ that adds a 'hex'
function to print hexidecimal numbers.
The only point that I exepect to be contended is it varies slightly from
the surrounding functions in that it allows one to control the number of
characters printed:
> hex 5 31
0001f
> hex 2 8
08
> hex 3 7495
d47
While we can argue about the consistancy issues, I almost always want to
control the number of digits when dealing with hex. Hence I feel this
is a reasonable special case.
Secondary Issues:
1) Is there a repo for pretty? I didn't see one on code.haskell.org
2) If I submit a ticket+patch to move Text.PrettyPrint.HughesPJClass
(from prettyclass, Augustsson) into Text.PrettyPrint (of the 'pretty'
package) would anyone object? It feels mis-placed / I feel things need
consolidated.
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: prettyPrintHex.patch
Type: text/x-patch
Size: 991 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/libraries/attachments/20090302/32cff86f/prettyPrintHex-0001.bin
More information about the Libraries
mailing list