hw-bits-0.6.0.0: Bit manipulation

Copyright2016 John Ky
LicenseMIT
Safe HaskellNone
LanguageHaskell2010

HaskellWorks.Data.Bits.BitWise

Contents

Description

Succinct operations.

Synopsis

Bit map

class BitWise a where Source #

Class of values that have bit wise logical operations

Minimal complete definition

(.&.), (.|.), (.^.), comp, all0s, all1s

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

BitWise Int Source # 
BitWise Word8 Source # 
BitWise Word16 Source # 
BitWise Word32 Source # 
BitWise Word64 Source # 
BitWise a => BitWise (Broadword a) Source # 
BitWise a => BitWise (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

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

TestBit Bool Source # 

Methods

(.?.) :: Bool -> Position -> Bool Source #

TestBit Int Source # 

Methods

(.?.) :: Int -> Position -> Bool Source #

TestBit Word8 Source # 

Methods

(.?.) :: Word8 -> Position -> Bool Source #

TestBit Word16 Source # 

Methods

(.?.) :: Word16 -> Position -> Bool Source #

TestBit Word32 Source # 

Methods

(.?.) :: Word32 -> Position -> Bool Source #

TestBit Word64 Source # 

Methods

(.?.) :: Word64 -> Position -> Bool Source #

TestBit [Bool] Source # 

Methods

(.?.) :: [Bool] -> Position -> Bool Source #

TestBit (Naive Word8) Source # 
TestBit (Naive Word16) Source # 
TestBit (Naive Word32) Source # 
TestBit (Naive Word64) Source # 
TestBit (Vector Word8) Source # 
TestBit (Vector Word16) Source # 
TestBit (Vector Word32) Source # 
TestBit (Vector Word64) Source # 
TestBit (Vector Word8) Source # 
TestBit (Vector Word16) Source # 
TestBit (Vector Word32) Source # 
TestBit (Vector Word64) Source # 
TestBit a => TestBit (BitShown a) Source # 

Methods

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