basement-0.0.16: Foundation scrap box of array & string

Safe Haskell | None
Language | Haskell2010

Basement.Types.Word128

Synopsis

- data Word128 = Word128 !Word64 !Word64
- (+) :: Word128 -> Word128 -> Word128
- (-) :: Word128 -> Word128 -> Word128
- (*) :: Word128 -> Word128 -> Word128
- quot :: Word128 -> Word128 -> Word128
- rem :: Word128 -> Word128 -> Word128
- bitwiseAnd :: Word128 -> Word128 -> Word128
- bitwiseOr :: Word128 -> Word128 -> Word128
- bitwiseXor :: Word128 -> Word128 -> Word128
- complement :: Word128 -> Word128
- shiftL :: Word128 -> Int -> Word128
- shiftR :: Word128 -> Int -> Word128
- rotateL :: Word128 -> Int -> Word128
- rotateR :: Word128 -> Int -> Word128
- popCount :: Word128 -> Int
- fromNatural :: Natural -> Word128

# Documentation

data Word128 Source #

128 bits Word

Constructors

Word128 !Word64 !Word64 |

#### Instances

Instances details

BitOps Word128 Source # |

Instance details

Defined in Basement.Bits

Methods

(.&.) :: Word128 -> Word128 -> Word128 Source #

(.|.) :: Word128 -> Word128 -> Word128 Source #

(.^.) :: Word128 -> Word128 -> Word128 Source #

(.<<.) :: Word128 -> CountOf Bool -> Word128 Source #

(.>>.) :: Word128 -> CountOf Bool -> Word128 Source #

bit :: Offset Bool -> Word128 Source #

isBitSet :: Word128 -> Offset Bool -> Bool Source #

setBit :: Word128 -> Offset Bool -> Word128 Source #

clearBit :: Word128 -> Offset Bool -> Word128 Source #

FiniteBitsOps Word128 Source # |

Instance details

Defined in Basement.Bits

Methods

numberOfBits :: Word128 -> CountOf Bool Source #

rotateL :: Word128 -> CountOf Bool -> Word128 Source #

rotateR :: Word128 -> CountOf Bool -> Word128 Source #

popCount :: Word128 -> CountOf Bool Source #

bitFlip :: Word128 -> Word128 Source #

countLeadingZeros :: Word128 -> CountOf Bool Source #

countTrailingZeros :: Word128 -> CountOf Bool Source #

HasNegation Word128 Source # |
Instance details Defined in Basement.Types.Word128 Methods negate :: Word128 -> Word128 Source #
Integral Word128 Source # |
Instance details Defined in Basement.Types.Word128 Methods fromInteger :: Integer -> Word128 Source #
NormalForm Word128 Source # |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: Word128 -> () Source #
Additive Word128 Source # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: Word128 Source # (+) :: Word128 -> Word128 -> Word128 Source # scale :: IsNatural n => n -> Word128 -> Word128 Source #
IDivisible Word128 Source # |
Instance details Defined in Basement.Numerical.Multiplicative Methods div :: Word128 -> Word128 -> Word128 Source # mod :: Word128 -> Word128 -> Word128 Source # divMod :: Word128 -> Word128 -> (Word128, Word128) Source #
Multiplicative Word128 Source # |
Instance details Defined in Basement.Numerical.Multiplicative Methods midentity :: Word128 Source # (*) :: Word128 -> Word128 -> Word128 Source # (^) :: (IsNatural n, Enum n, IDivisible n) => Word128 -> n -> Word128 Source #
IsIntegral Word128 Source # |
Instance details Defined in Basement.Types.Word128 Methods toInteger :: Word128 -> Integer Source #
IsNatural Word128 Source # |
Instance details Defined in Basement.Types.Word128 Methods toNatural :: Word128 -> Natural Source #
Subtractive Word128 Source # |

Instance details

Defined in Basement.Numerical.Subtractive

Associated Types

type Difference Word128 |
Instance details Defined in Basement.Numerical.Subtractive type Difference Word128 = Word128

Methods

(-) :: Word128 -> Word128 -> Difference Word128 Source #

PrimMemoryComparable Word128 Source # |
Instance details Defined in Basement.PrimType
PrimType Word128 Source # |

Instance details

Defined in Basement.PrimType

Associated Types

type PrimSize Word128 |
Instance details Defined in Basement.PrimType type PrimSize Word128 = 16

Methods

primSizeInBytes :: Proxy Word128 -> CountOf Word8 Source #

primShiftToBytes :: Proxy Word128 -> Int Source #

primBaUIndex :: ByteArray# -> Offset Word128 -> Word128 Source #

primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word128 -> prim Word128 Source #

primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word128 -> Word128 -> prim () Source #

primAddrIndex :: Addr# -> Offset Word128 -> Word128 Source #

primAddrRead :: PrimMonad prim => Addr# -> Offset Word128 -> prim Word128 Source #

primAddrWrite :: PrimMonad prim => Addr# -> Offset Word128 -> Word128 -> prim () Source #

Bits Word128 Source # |

Instance details

Defined in Basement.Types.Word128

Methods

(.&.) :: Word128 -> Word128 -> Word128 Source #

(.|.) :: Word128 -> Word128 -> Word128 Source #

xor :: Word128 -> Word128 -> Word128 Source #

complement :: Word128 -> Word128 Source #

shift :: Word128 -> Int -> Word128 Source #

rotate :: Word128 -> Int -> Word128 Source #

zeroBits :: Word128 Source #

bit :: Int -> Word128 Source #

setBit :: Word128 -> Int -> Word128 Source #

clearBit :: Word128 -> Int -> Word128 Source #

complementBit :: Word128 -> Int -> Word128 Source #

testBit :: Word128 -> Int -> Bool Source #

bitSizeMaybe :: Word128 -> Maybe Int Source #

bitSize :: Word128 -> Int Source #

isSigned :: Word128 -> Bool Source #

shiftL :: Word128 -> Int -> Word128 Source #

unsafeShiftL :: Word128 -> Int -> Word128 Source #

shiftR :: Word128 -> Int -> Word128 Source #

unsafeShiftR :: Word128 -> Int -> Word128 Source #

rotateL :: Word128 -> Int -> Word128 Source #

rotateR :: Word128 -> Int -> Word128 Source #

popCount :: Word128 -> Int Source #

Bounded Word128 Source # |
Instance details Defined in Basement.Types.Word128 Methods minBound :: Word128 Source # maxBound :: Word128 Source #
Enum Word128 Source # |

Instance details

Defined in Basement.Types.Word128

Methods

succ :: Word128 -> Word128 Source #

pred :: Word128 -> Word128 Source #

toEnum :: Int -> Word128 Source #

fromEnum :: Word128 -> Int Source #

enumFrom :: Word128 -> [Word128] Source #

enumFromThen :: Word128 -> Word128 -> [Word128] Source #

enumFromTo :: Word128 -> Word128 -> [Word128] Source #

enumFromThenTo :: Word128 -> Word128 -> Word128 -> [Word128] Source #

Storable Word128 Source # |

Instance details

Defined in Basement.Types.Word128

Methods

sizeOf :: Word128 -> Int Source #

alignment :: Word128 -> Int Source #

peekElemOff :: Ptr Word128 -> Int -> IO Word128 Source #

pokeElemOff :: Ptr Word128 -> Int -> Word128 -> IO () Source #

peekByteOff :: Ptr b -> Int -> IO Word128 Source #

pokeByteOff :: Ptr b -> Int -> Word128 -> IO () Source #

peek :: Ptr Word128 -> IO Word128 Source #

poke :: Ptr Word128 -> Word128 -> IO () Source #

Num Word128 Source # |
Instance details Defined in Basement.Types.Word128 Methods (+) :: Word128 -> Word128 -> Word128 Source # (-) :: Word128 -> Word128 -> Word128 Source # (*) :: Word128 -> Word128 -> Word128 Source # negate :: Word128 -> Word128 Source # abs :: Word128 -> Word128 Source # signum :: Word128 -> Word128 Source # fromInteger :: Integer -> Word128 Source #
Show Word128 Source # |
Instance details Defined in Basement.Types.Word128 Methods showsPrec :: Int -> Word128 -> ShowS Source # show :: Word128 -> String Source # showList :: [Word128] -> ShowS Source #
Eq Word128 Source # |
Instance details Defined in Basement.Types.Word128 Methods (==) :: Word128 -> Word128 -> Bool Source # (/=) :: Word128 -> Word128 -> Bool Source #
Ord Word128 Source # |
Instance details Defined in Basement.Types.Word128 Methods compare :: Word128 -> Word128 -> Ordering Source # (<) :: Word128 -> Word128 -> Bool Source # (<=) :: Word128 -> Word128 -> Bool Source # (>) :: Word128 -> Word128 -> Bool Source # (>=) :: Word128 -> Word128 -> Bool Source # max :: Word128 -> Word128 -> Word128 Source # min :: Word128 -> Word128 -> Word128 Source #
From Word128 Word256 Source # |
Instance details Defined in Basement.From Methods from :: Word128 -> Word256 Source #
From Word16 Word128 Source # |
Instance details Defined in Basement.From Methods from :: Word16 -> Word128 Source #
From Word32 Word128 Source # |
Instance details Defined in Basement.From Methods from :: Word32 -> Word128 Source #
From Word64 Word128 Source # |
Instance details Defined in Basement.From Methods from :: Word64 -> Word128 Source #
From Word8 Word128 Source # |
Instance details Defined in Basement.From Methods from :: Word8 -> Word128 Source #
(KnownNat n, NatWithinBound Word128 n) => From (Zn n) Word128 Source # |
Instance details Defined in Basement.From Methods from :: Zn n -> Word128 Source #
From (Zn64 n) Word128 Source # |
Instance details Defined in Basement.From Methods from :: Zn64 n -> Word128 Source #
type NatNumMaxBound Word128 Source # |
Instance details Defined in Basement.Nat type NatNumMaxBound Word128 = 340282366920938463463374607431768211455
type Difference Word128 Source # |
Instance details Defined in Basement.Numerical.Subtractive type Difference Word128 = Word128
type PrimSize Word128 Source # |
Instance details Defined in Basement.PrimType type PrimSize Word128 = 16

(+) :: Word128 -> Word128 -> Word128 Source #

Add 2 Word128

(-) :: Word128 -> Word128 -> Word128 Source #

Subtract 2 Word128

(*) :: Word128 -> Word128 -> Word128 Source #

Multiplication

quot :: Word128 -> Word128 -> Word128 Source #

Division

rem :: Word128 -> Word128 -> Word128 Source #

Modulo

bitwiseAnd :: Word128 -> Word128 -> Word128 Source #

Bitwise and

bitwiseOr :: Word128 -> Word128 -> Word128 Source #

Bitwise or

bitwiseXor :: Word128 -> Word128 -> Word128 Source #

Bitwise xor

complement :: Word128 -> Word128 Source #

Bitwise complement

shiftL :: Word128 -> Int -> Word128 Source #

Bitwise Shift Left

shiftR :: Word128 -> Int -> Word128 Source #

Bitwise Shift Right

rotateL :: Word128 -> Int -> Word128 Source #

Bitwise rotate Left

rotateR :: Word128 -> Int -> Word128 Source #

Bitwise rotate Left

popCount :: Word128 -> Int Source #

Population count

fromNatural :: Natural -> Word128 Source #