hw-bits-0.7.0.2: Bit manipulation

Contents

Synopsis

# Bit map

class BitWise a where Source #

Class of values that have bit wise logical operations

Minimal complete definition

Methods

(.&.) :: a -> a -> a infixl 7 Source #

Bit-wise AND

(.|.) :: a -> a -> a infixl 5 Source #

Bit-wise OR

(.^.) :: a -> a -> a infixl 6 Source #

Bit-wise XOR

comp :: a -> a Source #

Bit-wise complement

all0s :: a Source #

Bit-wise value of the given type with all bits set to zero

all1s :: a Source #

Bit-wise value of the given type with all bits set to one

Instances

 Source # Methods(.&.) :: Int -> Int -> Int Source #(.|.) :: Int -> Int -> Int Source #(.^.) :: Int -> Int -> Int Source # Source # Methods Source # Methods Source # Methods Source # Methods BitWise a => BitWise (Broadword a) Source # Methods(.&.) :: Broadword a -> Broadword a -> Broadword a Source #(.|.) :: Broadword a -> Broadword a -> Broadword a Source #(.^.) :: Broadword a -> Broadword a -> Broadword a Source # BitWise a => BitWise (Builtin a) Source # Methods(.&.) :: Builtin a -> Builtin a -> Builtin a Source #(.|.) :: Builtin a -> Builtin a -> Builtin a Source #(.^.) :: Builtin a -> Builtin a -> Builtin a Source #comp :: Builtin a -> Builtin a Source #

class Shift a where Source #

Class of values that have shift operations

Minimal complete definition

Methods

(.<.) :: a -> Count -> a infixl 8 Source #

Shift left by the specified count

(.>.) :: a -> Count -> a infixl 8 Source #

Shift right by the specified count

Instances

 Source # Methods(.<.) :: Int -> Count -> Int Source #(.>.) :: Int -> Count -> Int Source # Source # Methods Source # Methods Source # Methods Source # Methods

class TestBit a where Source #

Minimal complete definition

(.?.)

Methods

(.?.) :: a -> Position -> Bool infixl 9 Source #

Test whether the bit ad the given offset is set

Instances

 Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods(.?.) :: [Bool] -> Position -> Bool Source # Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods TestBit a => TestBit (BitShown a) Source # Methods(.?.) :: BitShown a -> Position -> Bool Source #