{-# LANGUAGE CPP #-}

module Hexploration.Byte where

import Data.Word
import Data.Word.Odd
#if MIN_VERSION_base(4,6,0)
import Data.DoubleWord
#else
import Data.LargeWord
#endif

-- | A 16 bits type (0x10 b)
type BytesX1 = Word16
-- | A 32 bits type (0x20 b)
type BytesX2 = Word32
-- | A 48 bits type (0x30 b)
type BytesX3 = Word48
-- | A 64 bits type (0x40 b)
type BytesX4 = Word64
-- | A 80 bits type (0x50 b)
type BytesX5 = OddWord Word96 (One (Zero (One (Zero (Zero (Zero (Zero ())))))))
-- | A 96 bits type (0x60 b)
type BytesX6 = Word96
-- | A 112 bits type (0x70 b)
type BytesX7 = OddWord Word128 (One (One (One (Zero (Zero (Zero (Zero ())))))))
-- | A 128 bits type (0x80 b)
type BytesX8 = Word128
-- | A 144 bits type (0x90 b)
type BytesX9 = OddWord Word160 (One (Zero (Zero (One (Zero (Zero (Zero (Zero ()))))))))
-- | A 160 bits type (0xA0 b)
type BytesXA = Word160
-- | A 176 bits type (0xB0 b)
type BytesXB = OddWord Word192 (One (Zero (One (One (Zero (Zero (Zero (Zero ()))))))))
-- | A 192 bits type (0xC0 b)
type BytesXC = Word192
-- | A 208 bits type (0xD0 b)
type BytesXD = OddWord Word224 (One (One (Zero (One (Zero (Zero (Zero (Zero ()))))))))
-- | A 224 bits type (0xE0 b)
type BytesXE = Word224
-- | A 240 bits type (0xF0 b)
type BytesXF = OddWord Word256 (One (One (One (One (Zero (Zero (Zero (Zero ()))))))))
-- | A 256 bits type (0x100 b)
type BytesX0 = Word256

-- | A byte has 16 bits.
type Byte = BytesX1
