Safe Haskell | Safe-Inferred |
---|---|
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 'BigEndian Source # | |
Defined in System.ByteOrder.Class Methods toFixedEndian :: Bytes a => a -> a Source # | |
FixedOrdering 'LittleEndian 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 Int16 Source # | |
Defined in System.ByteOrder.Class | |
Bytes Int32 Source # | |
Defined in System.ByteOrder.Class | |
Bytes Int64 Source # | |
Defined in System.ByteOrder.Class | |
Bytes Int8 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 | |
Bytes Word8 Source # | |
Defined in System.ByteOrder.Class | |
Bytes Word128 Source # | |
Defined in System.ByteOrder.Class | |
Bytes Word256 Source # | |
Defined in System.ByteOrder.Class | |
Bytes Word Source # | |
Defined in System.ByteOrder.Class |