
I would be strongly against naming it 'swap'. Lots of people in the community do not subscribe to the philosophy that all things should be imported qualified. 'byteSwap' or even 'byteswap' would be closer to the traditional 'bswap' name in spirit. -Edward On Thu, May 16, 2013 at 4:24 AM, Henning Thielemann < lemming@henning-thielemann.de> wrote:
On Thu, 16 May 2013, Vincent Hanquez wrote:
I'm trying to expose some byte swapping (bSwap) capabilities in base,
namely operation to allow to swap endianness on word{16,32,64}, i.e.:
bswap16 :: Word16 -> Word16 bswap16 a = (a `shiftR` 8) .|. (a `shiftL` 8) ...
If at all, I'd suggest a name without the 'b', since the other functions like 'shift' do not contain a 'b' as well. You can use qualification if you want to say that the swap is meant with respect to 'bits'.
______________________________**_________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/**mailman/listinfo/librarieshttp://www.haskell.org/mailman/listinfo/libraries