-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Stick two binary words together to get a bigger one
--
-- This package provides Template Haskell utilities for declaring
-- fixed-length binary word data types. Signed and unsigned 96, 128, 160,
-- 192, 224, and 256-bit types are predefined.
@package data-dword
@version 0.2.2
-- | Template Haskell utilities for generating double words declarations
module Data.DoubleWord.TH
-- | Declare signed and unsigned binary word types built from the specified
-- low and high halves. The high halves must have less or equal
-- bit-length than the lover half. For each data type the following
-- instances are declared: DoubleWord, Eq, Ord,
-- Bounded, Enum, Num, Real, Integral,
-- Show, Read, Hashable, Ix, Bits,
-- BinaryWord.
mkDoubleWord :: String -> String -> Strict -> Name -> String -> String -> Strict -> Name -> Strict -> Name -> [Name] -> Q [Dec]
-- | mkUnpackedDoubleWord u uh s sh l is an alias for
-- mkDoubleWord u u Unpacked uh s s Unpacked sh
-- Unpacked l
mkUnpackedDoubleWord :: String -> Name -> String -> Name -> Name -> [Name] -> Q [Dec]
-- | This module provides strict (low and high halves are unpacked) signed
-- and unsigned binary word data types of sizes 96, 128, 160, 192, 224,
-- and 256 bits.
module Data.DoubleWord
-- | Extra bit-manipulation functions for binary words of fixed length.
class Bits w => BinaryWord w where type family UnsignedWord w type family SignedWord w
unsignedWord :: BinaryWord w => w -> UnsignedWord w
signedWord :: BinaryWord w => w -> SignedWord w
unwrappedAdd :: BinaryWord w => w -> w -> (w, UnsignedWord w)
unwrappedMul :: BinaryWord w => w -> w -> (w, UnsignedWord w)
leadingZeroes :: BinaryWord w => w -> Int
trailingZeroes :: BinaryWord w => w -> Int
allZeroes :: BinaryWord w => w
allOnes :: BinaryWord w => w
msb :: BinaryWord w => w
lsb :: BinaryWord w => w
testMsb :: BinaryWord w => w -> Bool
testLsb :: BinaryWord w => w -> Bool
-- | Defines a particular way to split a binary word in halves.
class BinaryWord w => DoubleWord w where type family LoWord w type family HiWord w
loWord :: DoubleWord w => w -> LoWord w
hiWord :: DoubleWord w => w -> HiWord w
fromHiAndLo :: DoubleWord w => HiWord w -> LoWord w -> w
extendLo :: DoubleWord w => LoWord w -> w
signExtendLo :: DoubleWord w => SignedWord (LoWord w) -> w
data Word96
Word96 :: {-# UNPACK #-} !Word32 -> {-# UNPACK #-} !Word64 -> Word96
data Word128
Word128 :: {-# UNPACK #-} !Word64 -> {-# UNPACK #-} !Word64 -> Word128
data Word160
Word160 :: {-# UNPACK #-} !Word32 -> {-# UNPACK #-} !Word128 -> Word160
data Word192
Word192 :: {-# UNPACK #-} !Word64 -> {-# UNPACK #-} !Word128 -> Word192
data Word224
Word224 :: {-# UNPACK #-} !Word96 -> {-# UNPACK #-} !Word128 -> Word224
data Word256
Word256 :: {-# UNPACK #-} !Word128 -> {-# UNPACK #-} !Word128 -> Word256
data Int96
Int96 :: {-# UNPACK #-} !Int32 -> {-# UNPACK #-} !Word64 -> Int96
data Int128
Int128 :: {-# UNPACK #-} !Int64 -> {-# UNPACK #-} !Word64 -> Int128
data Int160
Int160 :: {-# UNPACK #-} !Int32 -> {-# UNPACK #-} !Word128 -> Int160
data Int192
Int192 :: {-# UNPACK #-} !Int64 -> {-# UNPACK #-} !Word128 -> Int192
data Int224
Int224 :: {-# UNPACK #-} !Int96 -> {-# UNPACK #-} !Word128 -> Int224
data Int256
Int256 :: {-# UNPACK #-} !Int128 -> {-# UNPACK #-} !Word128 -> Int256
instance Typeable Word256
instance Typeable Int256
instance Data Word256
instance Generic Word256
instance Data Int256
instance Generic Int256
instance Datatype D1Word256
instance Constructor C1_0Word256
instance Datatype D1Int256
instance Constructor C1_0Int256
instance BinaryWord Int256
instance Bits Int256
instance Ix Int256
instance Hashable Int256
instance Read Int256
instance Show Int256
instance Integral Int256
instance Real Int256
instance Num Int256
instance Enum Int256
instance Bounded Int256
instance Ord Int256
instance Eq Int256
instance DoubleWord Int256
instance BinaryWord Word256
instance Bits Word256
instance Ix Word256
instance Hashable Word256
instance Read Word256
instance Show Word256
instance Integral Word256
instance Real Word256
instance Num Word256
instance Enum Word256
instance Bounded Word256
instance Ord Word256
instance Eq Word256
instance DoubleWord Word256
instance Typeable Word224
instance Typeable Int224
instance Data Word224
instance Generic Word224
instance Data Int224
instance Generic Int224
instance Datatype D1Word224
instance Constructor C1_0Word224
instance Datatype D1Int224
instance Constructor C1_0Int224
instance BinaryWord Int224
instance Bits Int224
instance Ix Int224
instance Hashable Int224
instance Read Int224
instance Show Int224
instance Integral Int224
instance Real Int224
instance Num Int224
instance Enum Int224
instance Bounded Int224
instance Ord Int224
instance Eq Int224
instance DoubleWord Int224
instance BinaryWord Word224
instance Bits Word224
instance Ix Word224
instance Hashable Word224
instance Read Word224
instance Show Word224
instance Integral Word224
instance Real Word224
instance Num Word224
instance Enum Word224
instance Bounded Word224
instance Ord Word224
instance Eq Word224
instance DoubleWord Word224
instance Typeable Word192
instance Typeable Int192
instance Data Word192
instance Generic Word192
instance Data Int192
instance Generic Int192
instance Datatype D1Word192
instance Constructor C1_0Word192
instance Datatype D1Int192
instance Constructor C1_0Int192
instance BinaryWord Int192
instance Bits Int192
instance Ix Int192
instance Hashable Int192
instance Read Int192
instance Show Int192
instance Integral Int192
instance Real Int192
instance Num Int192
instance Enum Int192
instance Bounded Int192
instance Ord Int192
instance Eq Int192
instance DoubleWord Int192
instance BinaryWord Word192
instance Bits Word192
instance Ix Word192
instance Hashable Word192
instance Read Word192
instance Show Word192
instance Integral Word192
instance Real Word192
instance Num Word192
instance Enum Word192
instance Bounded Word192
instance Ord Word192
instance Eq Word192
instance DoubleWord Word192
instance Typeable Word160
instance Typeable Int160
instance Data Word160
instance Generic Word160
instance Data Int160
instance Generic Int160
instance Datatype D1Word160
instance Constructor C1_0Word160
instance Datatype D1Int160
instance Constructor C1_0Int160
instance BinaryWord Int160
instance Bits Int160
instance Ix Int160
instance Hashable Int160
instance Read Int160
instance Show Int160
instance Integral Int160
instance Real Int160
instance Num Int160
instance Enum Int160
instance Bounded Int160
instance Ord Int160
instance Eq Int160
instance DoubleWord Int160
instance BinaryWord Word160
instance Bits Word160
instance Ix Word160
instance Hashable Word160
instance Read Word160
instance Show Word160
instance Integral Word160
instance Real Word160
instance Num Word160
instance Enum Word160
instance Bounded Word160
instance Ord Word160
instance Eq Word160
instance DoubleWord Word160
instance Typeable Word128
instance Typeable Int128
instance Data Word128
instance Generic Word128
instance Data Int128
instance Generic Int128
instance Datatype D1Word128
instance Constructor C1_0Word128
instance Datatype D1Int128
instance Constructor C1_0Int128
instance BinaryWord Int128
instance Bits Int128
instance Ix Int128
instance Hashable Int128
instance Read Int128
instance Show Int128
instance Integral Int128
instance Real Int128
instance Num Int128
instance Enum Int128
instance Bounded Int128
instance Ord Int128
instance Eq Int128
instance DoubleWord Int128
instance BinaryWord Word128
instance Bits Word128
instance Ix Word128
instance Hashable Word128
instance Read Word128
instance Show Word128
instance Integral Word128
instance Real Word128
instance Num Word128
instance Enum Word128
instance Bounded Word128
instance Ord Word128
instance Eq Word128
instance DoubleWord Word128
instance Typeable Word96
instance Typeable Int96
instance Data Word96
instance Generic Word96
instance Data Int96
instance Generic Int96
instance Datatype D1Word96
instance Constructor C1_0Word96
instance Datatype D1Int96
instance Constructor C1_0Int96
instance BinaryWord Int96
instance Bits Int96
instance Ix Int96
instance Hashable Int96
instance Read Int96
instance Show Int96
instance Integral Int96
instance Real Int96
instance Num Int96
instance Enum Int96
instance Bounded Int96
instance Ord Int96
instance Eq Int96
instance DoubleWord Int96
instance BinaryWord Word96
instance Bits Word96
instance Ix Word96
instance Hashable Word96
instance Read Word96
instance Show Word96
instance Integral Word96
instance Real Word96
instance Num Word96
instance Enum Word96
instance Bounded Word96
instance Ord Word96
instance Eq Word96
instance DoubleWord Word96