HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulebyte-order-0.1.3.1Haskell2010

System.ByteOrder.Class

  • 2 classes
classclass FixedOrdering (b :: ByteOrder) where
#

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

Instances2FixedOrdering
classclass Bytes a where
#

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

    Convert from a native-endian word to a big-endian word.

  • toLittleEndian :: a -> a

    Convert from a native-endian word to a little-endian word.

Instances11Bytes, …
  • Bytes Int16Defined in byte-order-0.1.3.1 · System.ByteOrder.Class
  • Bytes Int32Defined in byte-order-0.1.3.1 · System.ByteOrder.Class
  • Bytes Int64Defined in byte-order-0.1.3.1 · System.ByteOrder.Class
  • Bytes Int8Defined in byte-order-0.1.3.1 · System.ByteOrder.Class
  • Bytes Word16Defined in byte-order-0.1.3.1 · System.ByteOrder.Class
  • Bytes Word32Defined in byte-order-0.1.3.1 · System.ByteOrder.Class
  • Bytes Word64Defined in byte-order-0.1.3.1 · System.ByteOrder.Class
  • Bytes Word8Defined in byte-order-0.1.3.1 · System.ByteOrder.Class
  • Bytes WordDefined in byte-order-0.1.3.1 · System.ByteOrder.Class
  • Bytes Word128Defined in byte-order-0.1.3.1 · System.ByteOrder.Class
  • Bytes Word256Defined in byte-order-0.1.3.1 · System.ByteOrder.Class