wnoise at ofb.net
Wed Nov 16 12:58:34 EST 2005
On 2005-11-13, Dominic Steinitz <dominic.steinitz at blueyonder.co.uk> wrote:
> On Sunday 13 Nov 2005 2:16 pm, Lemmih wrote:
>> On 11/13/05, Daan Leijen <daan at cs.uu.nl> wrote:
>> > Dominic Steinitz wrote:
>> > > I often find myself wanting to print out hex values as a string. I
>> > > couldn't
>> > Me too! And I also often want to see binary values (ie. 13 == 0x0D ==
>> > 0b1101)
>> > Just some information: I remember that there is a 'showHex' function in
>> > the "NumExts" module in Ghc (at least in version 5.x). See:
>> > <http://www.haskell.org/ghc/docs/latest/html/hslibs/sec-NumExts.html>
>> It's now Numeric from the 'base' package:
>> Prelude> Numeric.showIntAtBase 2 Char.intToDigit 99 ""
>> Prelude> Numeric.showHex 30 ""
> Yes I did try using that (in fact it's in the code I sent) but when you are
> printing out a 1024 bit key, it's not very useful. What I want is something
> so you can eyeball the octet you are looking for.
> Should a function like the one I want (and posted) go in NumExts?
No. There should be one that puts an item in a list every n items, that
you can cascade.
More information about the Libraries