Safe Haskell | None |
---|---|
Language | Haskell98 |
Dealing with endianness issues
- data Endian
- isLittleEndian :: Endian -> Bool
- isBigEndian :: Endian -> Bool
- hostEndian :: Endian
- detectHostEndian :: IO Endian
- class HasByteOrder a where
- toMachineBytes :: HasByteOrder a => a -> [Word8]
- fromMachineBytes :: HasByteOrder a => [Word8] -> a
- swapByteOrderToLE :: HasByteOrder a => a -> a
- swapByteOrderToBE :: HasByteOrder a => a -> a
Documentation
isLittleEndian :: Endian -> Bool Source #
isBigEndian :: Endian -> Bool Source #
hostEndian :: Endian Source #
class HasByteOrder a where Source #
swapByteOrder :: a -> a Source #
swaps the byte order
toLilEndBytes :: a -> [Word8] Source #
toBigEndBytes :: a -> [Word8] Source #
fromLilEndBytes :: [Word8] -> a Source #
fromBigEndBytes :: [Word8] -> a Source #
toMachineBytes :: HasByteOrder a => a -> [Word8] Source #
Native memory order
fromMachineBytes :: HasByteOrder a => [Word8] -> a Source #
Native memory order
swapByteOrderToLE :: HasByteOrder a => a -> a Source #
on little-endian hosts, this is identity; on big-endian hosts, it swaps the byte order
swapByteOrderToBE :: HasByteOrder a => a -> a Source #
on big-endian hosts, this is identity; on little-endian hosts, it swaps the byte order