[Haskell-cafe] Re: Binary IO of a list of ints
Jamie Love
jamie.love at aviarc.com.au
Thu Jan 24 07:07:40 EST 2008
Stephan Walter wrote:
> Hi,
>
> On 2008-01-24 12:14, Jamie Love wrote:
>
>> I have a list of ints, with values between 0 and 255 and I need to print
>> them out in little endian form to a file.
>>
>
> How about just using Data.Char.chr ?
>
Essentially because I need to control the byte ordering, and it has to
be in the current case the opposite to my computer's native ordering
(the file is a binary file).
> Prelude> let a = [32..64] :: [Int]
> Prelude> map Data.Char.chr a
> " !\"#$%&'()*+,-./0123456789:;<=>?@"
>
>
> --Stephan
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
> ------------------------------------------------------------
>
> This message has been scanned for viruses and dangerous content
> by MailScanner and is believed to be clean.
>
>
>
--
Jamie Love
Senior Consultant
Aviarc Australia
Mobile: +61 400 548 048
------------------------------------------------------------
This message has been scanned for viruses and dangerous content
by MailScanner and is believed to be clean.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080124/18018dad/attachment.htm
More information about the Haskell-Cafe
mailing list