| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
System.ByteOrder.Class
Synopsis
- class FixedOrdering (b :: ByteOrder) where
- toFixedEndian :: Bytes a => a -> a
- class Bytes a where
- toBigEndian :: a -> a
- toLittleEndian :: a -> a
Documentation
class FixedOrdering (b :: ByteOrder) where Source #
A byte order that can be interpreted as a conversion function.
This class is effectively closed. The only instances are for
BigEndian and LittleEndian. It is not possible to write more
instances since there are no other inhabitants of ByteOrder.
Methods
toFixedEndian :: Bytes a => a -> a Source #
Instances
| FixedOrdering LittleEndian Source # | |
Defined in System.ByteOrder.Class Methods toFixedEndian :: Bytes a => a -> a Source # | |
| FixedOrdering BigEndian Source # | |
Defined in System.ByteOrder.Class Methods toFixedEndian :: Bytes a => a -> a Source # | |
Types that are represented as a fixed-sized word. For these types, the bytes can be swapped. The instances of this class use byteswapping primitives and compile-time knowledge of native endianness to provide portable endianness conversion functions.
Methods
toBigEndian :: a -> a Source #
Convert from a native-endian word to a big-endian word.
toLittleEndian :: a -> a Source #
Convert from a native-endian word to a little-endian word.
Instances
| Bytes Int8 Source # | |
Defined in System.ByteOrder.Class | |
| Bytes Int16 Source # | |
Defined in System.ByteOrder.Class | |
| Bytes Int32 Source # | |
Defined in System.ByteOrder.Class | |
| Bytes Int64 Source # | |
Defined in System.ByteOrder.Class | |
| Bytes Word8 Source # | |
Defined in System.ByteOrder.Class | |
| Bytes Word16 Source # | |
Defined in System.ByteOrder.Class | |
| Bytes Word32 Source # | |
Defined in System.ByteOrder.Class | |
| Bytes Word64 Source # | |
Defined in System.ByteOrder.Class | |