Ticket #3058: Add 'hex' to the pretty package (and other thoughts)

Thomas DuBuisson thomas.dubuisson at gmail.com
Sat Mar 14 20:31:01 EDT 2009

> are the "Pad" functions ones that (as mentioned above) are willing not just to
> add padding but to chop off higher-order digits?  I find the name misleading.

Yes, and I agree the name is misleading.  Does anyone have a
suggestion of a better name?

> Also hexPad and intAtBasePad each add (compared to the non-Pad versions) an
> Int argument, but octPad adds an Int and a Maybe Int argument?  why is this?
That's not right - don't know how that error happened, perhaps a
toy-version of the library was loaded.  Here is a copy paste of the
type signature and some uses:

Prelude Text.PrettyPrint> :i octPad
octPad :: (Integral a) => a -> Int -> Doc
Prelude Text.PrettyPrint> octPad 10 2
Prelude Text.PrettyPrint> hexPad 133 3
Prelude Text.PrettyPrint> hexPad 133 2
Prelude Text.PrettyPrint> hexPad 133 1

More information about the Libraries mailing list