Safe Haskell | None |
---|---|
Language | Haskell2010 |
A Vector
interface to packed sequences of bits
- class (Type w, Numeric w, Bits w, Integral w) => Unit w where
- data BitVector w = BitVector {}
- data Segment w = Segment {}
- length :: forall w. Unit w => BitVector w -> Data Length
- numOfUnits :: Unit w => BitVector w -> Data Length
- freezeBitVector :: forall w. Unit w => BitVector w -> Data [w]
- unfreezeBitVector :: forall w. Unit w => Data [w] -> BitVector w
- fromVector :: forall w. (Unit w, Size w ~ Range w) => Vector (Data Bool) -> BitVector w
- toVector :: forall w. (Unit w, Size w ~ Range w) => BitVector w -> Vector (Data Bool)
- fromBits :: forall w. Unit w => [Bool] -> BitVector w
- fromUnits :: Unit w => [w] -> BitVector w
- replUnit :: Unit w => Data Length -> w -> BitVector w
- indexed :: (Unit w, Size w ~ Range w) => Data Length -> (Data Index -> Data Bool) -> BitVector w
- map :: (Unit w, Size w ~ Range w) => (Data Bool -> Data Bool) -> BitVector w -> BitVector w
- takeUnits :: forall w. Unit w => Data Length -> BitVector w -> BitVector w
- dropUnits :: forall w. Unit w => Data Length -> BitVector w -> BitVector w
- (++) :: forall w. Unit w => BitVector w -> BitVector w -> BitVector w
- drop :: forall w. (Unit w, Size w ~ Range w) => Data Length -> Data w -> BitVector w -> BitVector w
- fold :: forall w a. (Syntax a, Unit w, Size w ~ Range w) => (a -> Data Bool -> a) -> a -> BitVector w -> a
- zipWith :: forall w. (Unit w, Size w ~ Range w) => (Data Bool -> Data Bool -> Data Bool) -> BitVector w -> BitVector w -> BitVector w
- head :: (Unit w, Size w ~ Range w) => BitVector w -> Data Bool
- tail :: forall w. (Unit w, Size w ~ Range w) => Data Bool -> BitVector w -> BitVector w
- boolFun1 :: (Syntax t, Unit w, Size w ~ Range w) => (Data Bool -> Data Bool) -> ((Data w -> Data w) -> t) -> t
- boolFun2 :: (Syntax t, Unit w, Size w ~ Range w) => (Data Bool -> Data Bool -> Data Bool) -> ((Data w -> Data w -> Data w) -> t) -> t
- tBV :: Patch w w -> Patch (BitVector w) (BitVector w)
Types and classes
Feldspar integration of BitVector
Operations
freezeBitVector :: forall w. Unit w => BitVector w -> Data [w] Source
unfreezeBitVector :: forall w. Unit w => Data [w] -> BitVector w Source
fromVector :: forall w. (Unit w, Size w ~ Range w) => Vector (Data Bool) -> BitVector w Source
Transforms a bool vector to a bitvector. Length of the vector has to be divisible by the wordlength, otherwise booleans at the end will be dropped.
indexed :: (Unit w, Size w ~ Range w) => Data Length -> (Data Index -> Data Bool) -> BitVector w Source
drop :: forall w. (Unit w, Size w ~ Range w) => Data Length -> Data w -> BitVector w -> BitVector w Source
fold :: forall w a. (Syntax a, Unit w, Size w ~ Range w) => (a -> Data Bool -> a) -> a -> BitVector w -> a Source
zipWith :: forall w. (Unit w, Size w ~ Range w) => (Data Bool -> Data Bool -> Data Bool) -> BitVector w -> BitVector w -> BitVector w Source
Boolean functions extended to words
boolFun1 :: (Syntax t, Unit w, Size w ~ Range w) => (Data Bool -> Data Bool) -> ((Data w -> Data w) -> t) -> t Source
boolFun2 :: (Syntax t, Unit w, Size w ~ Range w) => (Data Bool -> Data Bool -> Data Bool) -> ((Data w -> Data w -> Data w) -> t) -> t Source