copilot-language-3.11: A Haskell-embedded DSL for monitoring hard real-time distributed systems.
Safe HaskellSafe
LanguageHaskell2010

Copilot.Language.Operators.BitWise

Description

Bitwise operators applied on streams, pointwise.

Synopsis

Documentation

class Eq a => Bits a where #

The Bits class defines bitwise operations over integral types.

  • Bits are numbered from 0 with bit 0 being the least significant bit.

Methods

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

Bitwise "and"

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

Bitwise "or"

complement :: a -> a #

Reverse all the bits in the argument

Instances

Instances details
Bits Int16

Since: base-2.1

Instance details

Defined in GHC.Int

Bits Int32

Since: base-2.1

Instance details

Defined in GHC.Int

Bits Int64

Since: base-2.1

Instance details

Defined in GHC.Int

Bits Int8

Since: base-2.1

Instance details

Defined in GHC.Int

Bits Word16

Since: base-2.1

Instance details

Defined in GHC.Word

Bits Word32

Since: base-2.1

Instance details

Defined in GHC.Word

Bits Word64

Since: base-2.1

Instance details

Defined in GHC.Word

Bits Word8

Since: base-2.1

Instance details

Defined in GHC.Word

Bits Integer

Since: base-2.1

Instance details

Defined in GHC.Bits

Bits Natural

Since: base-4.8.0

Instance details

Defined in GHC.Bits

Bits Bool

Interpret Bool as 1-bit bit-field

Since: base-4.7.0.0

Instance details

Defined in GHC.Bits

Bits Int

Since: base-2.1

Instance details

Defined in GHC.Bits

Methods

(.&.) :: Int -> Int -> Int #

(.|.) :: Int -> Int -> Int #

xor :: Int -> Int -> Int #

complement :: Int -> Int #

shift :: Int -> Int -> Int #

rotate :: Int -> Int -> Int #

zeroBits :: Int #

bit :: Int -> Int #

setBit :: Int -> Int -> Int #

clearBit :: Int -> Int -> Int #

complementBit :: Int -> Int -> Int #

testBit :: Int -> Int -> Bool #

bitSizeMaybe :: Int -> Maybe Int #

bitSize :: Int -> Int #

isSigned :: Int -> Bool #

shiftL :: Int -> Int -> Int #

unsafeShiftL :: Int -> Int -> Int #

shiftR :: Int -> Int -> Int #

unsafeShiftR :: Int -> Int -> Int #

rotateL :: Int -> Int -> Int #

rotateR :: Int -> Int -> Int #

popCount :: Int -> Int #

Bits Word

Since: base-2.1

Instance details

Defined in GHC.Bits

Bits a => Bits (And a)

Since: base-4.16

Instance details

Defined in Data.Bits

Methods

(.&.) :: And a -> And a -> And a #

(.|.) :: And a -> And a -> And a #

xor :: And a -> And a -> And a #

complement :: And a -> And a #

shift :: And a -> Int -> And a #

rotate :: And a -> Int -> And a #

zeroBits :: And a #

bit :: Int -> And a #

setBit :: And a -> Int -> And a #

clearBit :: And a -> Int -> And a #

complementBit :: And a -> Int -> And a #

testBit :: And a -> Int -> Bool #

bitSizeMaybe :: And a -> Maybe Int #

bitSize :: And a -> Int #

isSigned :: And a -> Bool #

shiftL :: And a -> Int -> And a #

unsafeShiftL :: And a -> Int -> And a #

shiftR :: And a -> Int -> And a #

unsafeShiftR :: And a -> Int -> And a #

rotateL :: And a -> Int -> And a #

rotateR :: And a -> Int -> And a #

popCount :: And a -> Int #

Bits a => Bits (Iff a)

Since: base-4.16

Instance details

Defined in Data.Bits

Methods

(.&.) :: Iff a -> Iff a -> Iff a #

(.|.) :: Iff a -> Iff a -> Iff a #

xor :: Iff a -> Iff a -> Iff a #

complement :: Iff a -> Iff a #

shift :: Iff a -> Int -> Iff a #

rotate :: Iff a -> Int -> Iff a #

zeroBits :: Iff a #

bit :: Int -> Iff a #

setBit :: Iff a -> Int -> Iff a #

clearBit :: Iff a -> Int -> Iff a #

complementBit :: Iff a -> Int -> Iff a #

testBit :: Iff a -> Int -> Bool #

bitSizeMaybe :: Iff a -> Maybe Int #

bitSize :: Iff a -> Int #

isSigned :: Iff a -> Bool #

shiftL :: Iff a -> Int -> Iff a #

unsafeShiftL :: Iff a -> Int -> Iff a #

shiftR :: Iff a -> Int -> Iff a #

unsafeShiftR :: Iff a -> Int -> Iff a #

rotateL :: Iff a -> Int -> Iff a #

rotateR :: Iff a -> Int -> Iff a #

popCount :: Iff a -> Int #

Bits a => Bits (Ior a)

Since: base-4.16

Instance details

Defined in Data.Bits

Methods

(.&.) :: Ior a -> Ior a -> Ior a #

(.|.) :: Ior a -> Ior a -> Ior a #

xor :: Ior a -> Ior a -> Ior a #

complement :: Ior a -> Ior a #

shift :: Ior a -> Int -> Ior a #

rotate :: Ior a -> Int -> Ior a #

zeroBits :: Ior a #

bit :: Int -> Ior a #

setBit :: Ior a -> Int -> Ior a #

clearBit :: Ior a -> Int -> Ior a #

complementBit :: Ior a -> Int -> Ior a #

testBit :: Ior a -> Int -> Bool #

bitSizeMaybe :: Ior a -> Maybe Int #

bitSize :: Ior a -> Int #

isSigned :: Ior a -> Bool #

shiftL :: Ior a -> Int -> Ior a #

unsafeShiftL :: Ior a -> Int -> Ior a #

shiftR :: Ior a -> Int -> Ior a #

unsafeShiftR :: Ior a -> Int -> Ior a #

rotateL :: Ior a -> Int -> Ior a #

rotateR :: Ior a -> Int -> Ior a #

popCount :: Ior a -> Int #

Bits a => Bits (Xor a)

Since: base-4.16

Instance details

Defined in Data.Bits

Methods

(.&.) :: Xor a -> Xor a -> Xor a #

(.|.) :: Xor a -> Xor a -> Xor a #

xor :: Xor a -> Xor a -> Xor a #

complement :: Xor a -> Xor a #

shift :: Xor a -> Int -> Xor a #

rotate :: Xor a -> Int -> Xor a #

zeroBits :: Xor a #

bit :: Int -> Xor a #

setBit :: Xor a -> Int -> Xor a #

clearBit :: Xor a -> Int -> Xor a #

complementBit :: Xor a -> Int -> Xor a #

testBit :: Xor a -> Int -> Bool #

bitSizeMaybe :: Xor a -> Maybe Int #

bitSize :: Xor a -> Int #

isSigned :: Xor a -> Bool #

shiftL :: Xor a -> Int -> Xor a #

unsafeShiftL :: Xor a -> Int -> Xor a #

shiftR :: Xor a -> Int -> Xor a #

unsafeShiftR :: Xor a -> Int -> Xor a #

rotateL :: Xor a -> Int -> Xor a #

rotateR :: Xor a -> Int -> Xor a #

popCount :: Xor a -> Int #

Bits a => Bits (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Bits a => Bits (Down a)

Since: base-4.14.0.0

Instance details

Defined in Data.Ord

Methods

(.&.) :: Down a -> Down a -> Down a #

(.|.) :: Down a -> Down a -> Down a #

xor :: Down a -> Down a -> Down a #

complement :: Down a -> Down a #

shift :: Down a -> Int -> Down a #

rotate :: Down a -> Int -> Down a #

zeroBits :: Down a #

bit :: Int -> Down a #

setBit :: Down a -> Int -> Down a #

clearBit :: Down a -> Int -> Down a #

complementBit :: Down a -> Int -> Down a #

testBit :: Down a -> Int -> Bool #

bitSizeMaybe :: Down a -> Maybe Int #

bitSize :: Down a -> Int #

isSigned :: Down a -> Bool #

shiftL :: Down a -> Int -> Down a #

unsafeShiftL :: Down a -> Int -> Down a #

shiftR :: Down a -> Int -> Down a #

unsafeShiftR :: Down a -> Int -> Down a #

rotateL :: Down a -> Int -> Down a #

rotateR :: Down a -> Int -> Down a #

popCount :: Down a -> Int #

(Typed a, Bits a) => Bits (Stream a) Source #

Instance of the Bits class for Streams.

Only the methods .&., complement, .|. and xor are defined.

Instance details

Defined in Copilot.Language.Operators.BitWise

Methods

(.&.) :: Stream a -> Stream a -> Stream a #

(.|.) :: Stream a -> Stream a -> Stream a #

xor :: Stream a -> Stream a -> Stream a #

complement :: Stream a -> Stream a #

shift :: Stream a -> Int -> Stream a #

rotate :: Stream a -> Int -> Stream a #

zeroBits :: Stream a #

bit :: Int -> Stream a #

setBit :: Stream a -> Int -> Stream a #

clearBit :: Stream a -> Int -> Stream a #

complementBit :: Stream a -> Int -> Stream a #

testBit :: Stream a -> Int -> Bool #

bitSizeMaybe :: Stream a -> Maybe Int #

bitSize :: Stream a -> Int #

isSigned :: Stream a -> Bool #

shiftL :: Stream a -> Int -> Stream a #

unsafeShiftL :: Stream a -> Int -> Stream a #

shiftR :: Stream a -> Int -> Stream a #

unsafeShiftR :: Stream a -> Int -> Stream a #

rotateL :: Stream a -> Int -> Stream a #

rotateR :: Stream a -> Int -> Stream a #

popCount :: Stream a -> Int #

(.^.) :: Bits a => a -> a -> a Source #

See xor.

(.<<.) :: (Bits a, Typed a, Typed b, Integral b) => Stream a -> Stream b -> Stream a Source #

Shifting values of a stream to the left.

(.>>.) :: (Bits a, Typed a, Typed b, Integral b) => Stream a -> Stream b -> Stream a Source #

Shifting values of a stream to the right.

Orphan instances

(Typed a, Bits a) => Bits (Stream a) Source #

Instance of the Bits class for Streams.

Only the methods .&., complement, .|. and xor are defined.

Instance details

Methods

(.&.) :: Stream a -> Stream a -> Stream a #

(.|.) :: Stream a -> Stream a -> Stream a #

xor :: Stream a -> Stream a -> Stream a #

complement :: Stream a -> Stream a #

shift :: Stream a -> Int -> Stream a #

rotate :: Stream a -> Int -> Stream a #

zeroBits :: Stream a #

bit :: Int -> Stream a #

setBit :: Stream a -> Int -> Stream a #

clearBit :: Stream a -> Int -> Stream a #

complementBit :: Stream a -> Int -> Stream a #

testBit :: Stream a -> Int -> Bool #

bitSizeMaybe :: Stream a -> Maybe Int #

bitSize :: Stream a -> Int #

isSigned :: Stream a -> Bool #

shiftL :: Stream a -> Int -> Stream a #

unsafeShiftL :: Stream a -> Int -> Stream a #

shiftR :: Stream a -> Int -> Stream a #

unsafeShiftR :: Stream a -> Int -> Stream a #

rotateL :: Stream a -> Int -> Stream a #

rotateR :: Stream a -> Int -> Stream a #

popCount :: Stream a -> Int #