proposal/RFC: add bSwap to base in Data.Bits
ekmett at gmail.com
Thu May 16 11:07:51 CEST 2013
Henning has a point.
EndianSensitive is arguably the more appropriate notion.
What does it mean to 'byteSwap' an 'Integer'? Or a bit vector of length n?
On Thu, May 16, 2013 at 4:59 AM, Henning Thielemann <
lemming at henning-thielemann.de> wrote:
> On Thu, 16 May 2013, Vincent Hanquez wrote:
> On Thu, May 16, 2013 at 10:24:31AM +0200, Henning Thielemann wrote:
>>> If at all, I'd suggest a name without the 'b', since the other
>>> functions like 'shift' do not contain a 'b' as well.
>> apologies if i misunderstood you, but i think that's the whole point.
>> the b is there because it's different than shift.
>> shift works on bits, and bswap works on bytes.
> If it would work on bits, I would certainly not call it swap, but
> 'reverse'. On the MC68000 processor there was an assembly instruction
> "swap" that swapped upper and lower 16 bits of a 32 bit word.
> However if you really only want to swap byte order (and not 16 bit words
> within 64 bit words and so on), then how about just using a package like
> Libraries mailing list
> Libraries at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libraries